Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: Skip inet6 addresses matching ::1 #1838

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

feld
Copy link
Contributor

@feld feld commented Sep 11, 2024

Fixes #1835

@feld feld requested review from a team as code owners September 11, 2024 19:18
@tpowell-progress
Copy link
Contributor

@feld please add DCO

@@ -68,6 +68,7 @@
end
end
if line =~ /\s+inet6 ([a-f0-9\:]+)%?(\w*)\s+prefixlen\s+(\d+)\s*\w*\s*([\da-fx]*)/
next if $1 == "::1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is the right approach. Is ::1 the only inet6 line in your ifconfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I have fe80 addresses on all the interfaces and those are properly excluded.

Sometimes ::1 is on lo1 and not lo0, but it should always see my inet6 addresses starting with 2600 first and it doesn't pick them up. It always takes the ::1 as the default address for some strange reason.

On a very vanilla out-of-the-box FreeBSD install with IPv6 enabled Chef will pick up ::1 as the IPv6 address. This is the only way I found to fix it.

@tpowell-progress tpowell-progress self-assigned this Oct 1, 2024
@tpowell-progress tpowell-progress added the Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. label Oct 1, 2024
Copy link

sonarcloud bot commented Oct 10, 2024

jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
@jaymzh
Copy link
Collaborator

jaymzh commented Oct 22, 2024

After writing #1841 I THINK I know what the problem is here.

FreeBSD reports no scope for global addresses. Further, it uses scopeIDs, not scopes, so the sorting that happens here doesn't work at all.

So the right fix here is to modify this code to:

  1. Convert scopeIds into scope names
  2. If no scopeID is there, just set it to 'global' which seems to be what FreeBSD is assuming.

jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
jaymzh added a commit to jaymzh/ohai that referenced this pull request Oct 22, 2024
This adds unittests for the FreeBSD network plugin. It also fixes
various issues:

* It now running on modern freebsd which has extra columns in netstat output.
* It now properly reports encapuslation, MTU, and metric

It also includes a test case with `::1` on `lo1` to start building out
support for sorting out chef#1838

Signed-off-by: Phil Dibowitz <[email protected]>
@jaymzh
Copy link
Collaborator

jaymzh commented Nov 5, 2024

@feld - ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting on Contributor A pull request that has unresolved requested actions from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ip6address not detected correctly on FreeBSD
3 participants