Skip to content

Add IPv6 support to getifaddrs() on Bsd#1436

Open
izissise wants to merge 2 commits intojart:masterfrom
izissise:getifaddrs-bsd
Open

Add IPv6 support to getifaddrs() on Bsd#1436
izissise wants to merge 2 commits intojart:masterfrom
izissise:getifaddrs-bsd

Conversation

@izissise
Copy link
Copy Markdown
Contributor

  • Add bswap_128()
  • Add IPv6 support to getifaddrs() on Bsd
    Tested on x86_64 MacOs OpenBsd FreeBsd and NetBsd.

There is extra ioctl calls on the ipv6 bsd path
because SIOCGIFCONF doesn't returns the addr flag
or the netmask.

Luckily all bsd systems share the same values for
SIOCGIFAFLAG_IN6 and SIOCGIFNETMASK_IN6.

@izissise izissise changed the title Getifaddrs bsd Add IPv6 support to getifaddrs() on Bsd Aug 13, 2025
Copy link
Copy Markdown
Owner

@jart jart left a comment

Choose a reason for hiding this comment

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

Wow this is great. I wish Linux had this! Thank you for doing this.

Comment thread libc/intrin/bswap.h
This greatly helps for IPv6 endianess convertion
Tested on x86_64 MacOs OpenBsd FreeBsd and NetBsd.

There is extra ioctl calls on the ipv6 bsd path
because SIOCGIFCONF doesn't returns the addr flag
or the netmask.

Luckily all bsd systems share the same values for
SIOCGIFAFLAG_IN6 and SIOCGIFNETMASK_IN6.
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.

2 participants