Skip to content

capture-nics-fixups#1000

Merged
buger merged 1 commit into
probelabs:masterfrom
DimaGolomozy:loopback-capture-fixup
Aug 19, 2021
Merged

capture-nics-fixups#1000
buger merged 1 commit into
probelabs:masterfrom
DimaGolomozy:loopback-capture-fixup

Conversation

@DimaGolomozy

@DimaGolomozy DimaGolomozy commented Aug 18, 2021

Copy link
Copy Markdown
Contributor
  1. move the isDevice(l.host, pi) to be first, as no need to iterate on all nics if it returns true
  2. first compare by name, as same nics will have same names
  3. if not found by name, compare by ips.

the bug was the strings.HasPrefix
2 different nics with ipv6:

#nic1 ip: f1234::55
#nic2 ip: f1234::55::66::66

so because of the strings.HasPrefix it was evaluated as the name nics. but they are not.

@buger ^
it should also be a fix to release-1.3

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.6% 0.6% Duplication

@buger buger merged commit 02a0904 into probelabs:master Aug 19, 2021
buger pushed a commit that referenced this pull request Aug 19, 2021
1. move the `isDevice(l.host, pi)` to be first, as no need to iterate on all nics if it returns `true`
2. first compare by name, as same nics will have same names
3. if not found by name, compare by ips.

the bug was the `strings.HasPrefix`
2 different nics with ipv6:
```
#nic1 ip: f1234::55
#nic2 ip: f1234::55::66::66
```

so because of the `strings.HasPrefix` it was evaluated as the name nics. but they are not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants