Skip to content

V1.3.2 thomas#1

Draft
akevdmeer wants to merge 4 commits into
masterfrom
v1.3.2-thomas
Draft

V1.3.2 thomas#1
akevdmeer wants to merge 4 commits into
masterfrom
v1.3.2-thomas

Conversation

@akevdmeer
Copy link
Copy Markdown
Owner

No description provided.

DimaGolomozy and others added 4 commits August 16, 2021 19:07
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.
@akevdmeer
Copy link
Copy Markdown
Owner Author

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Interface matching

Comparing a.String() to pa.IP.String() will usually fail for addressed interfaces because a.String() commonly includes the subnet mask (for example 192.168.1.10/24) while pa.IP.String() is only the IP. On hosts where the interface names do not match exactly, ni stays unset, so loopback detection and any later logic that depends on the matched net.Interface can break.

if a.String() == pa.IP.String() {
	ni = i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants