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: replace getnameinfo with inet_ntop #462

Conversation

correabuscar
Copy link
Contributor

@correabuscar correabuscar commented Nov 6, 2022

also make IPv6 work (previously it was commented out)

(re)tested it to work in freebsd 13.1 in virtualbox, not just to compile.

Note that, unlike in Linux, if all IPv4 and IPv6 IPs are missing, then the interface MAC isn't shown in their place (but this is a different issue)

@correabuscar correabuscar force-pushed the freebsd_replace__getnameinfo__with__inet_ntop branch from 5fe2891 to e938ccb Compare November 6, 2022 11:01
@correabuscar correabuscar force-pushed the freebsd_replace__getnameinfo__with__inet_ntop branch from e938ccb to 12def52 Compare November 6, 2022 11:04
Copy link
Owner

@aristocratos aristocratos left a comment

Choose a reason for hiding this comment

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

Looks good! 👍🏼

Not sure why IPv6 addresses was previously disabled but looks to be working fine.

@aristocratos aristocratos merged commit 20df836 into aristocratos:main Nov 6, 2022
@aristocratos
Copy link
Owner

Note that, unlike in Linux, if all IPv4 and IPv6 IPs are missing, then the interface MAC isn't shown in their place (but this is a different issue)

Yeah, there is currently no method employed to get the MAC address in freebsd (or macos I think). In linux it's collected from /sys/class/net/<iface>/address if no IPv4 or IPv6 address has been found.

correabuscar added a commit to correabuscar/btop that referenced this pull request Nov 6, 2022
this is like PR aristocratos#462 for FreeBSD,
and like PR aristocratos#458 for Linux.
correabuscar added a commit to correabuscar/btop that referenced this pull request Nov 6, 2022
this is like PR aristocratos#462 for FreeBSD,
and like PR aristocratos#458 for Linux.
correabuscar added a commit to correabuscar/btop that referenced this pull request Nov 6, 2022
this is like PR aristocratos#462 for FreeBSD,
and like PR aristocratos#458 for Linux.
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