Skip to content

Ip6 getifaddrs - #1415

Merged
jart merged 3 commits into
jart:masterfrom
izissise:ip6-getifaddrs
May 21, 2025
Merged

jart merged 3 commits into
jart:masterfrom
izissise:ip6-getifaddrs

Conversation

@izissise

Copy link
Copy Markdown
Contributor

Github discussion: #1412

This is Linux only, I don't known how to implement this for other platforms, any help is welcome.

Reading the /proc/net/if_inet6 pseudo-file allows parsing IPv6 addresses,
which are now included in the list returned by getifaddrs().

This patch:

  • Adds support for AF_INET6 entries by reading from the procfs
  • Parses scope, prefix length, and flags from the if_inet6 format
  • Constructs sockaddr_in6 and attaches them to ifaddrs structs
  • Maintains compatibility with existing AF_INET handling
  • Adds IfAddr6 and supporting structures to represent IPv6 info

@jart jart left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good. Could you sync to head for a cachestat CI fix so we can verify tests work? Also could you send the email mentioned in CONTRIBUTING.md? Thanks!

izissise added 3 commits May 21, 2025 08:38
Netmask address was used to display the network broadcast address.
Reading the `/proc/net/if_inet6` pseudo-file allows parsing IPv6 addresses,
which are now included in the list returned by `getifaddrs()`.

This patch:
- Adds support for AF_INET6 entries by reading from the procfs
- Parses scope, prefix length, and flags from the if_inet6 format
- Constructs `sockaddr_in6` and attaches them to `ifaddrs` structs
- Maintains compatibility with existing AF_INET handling
- Adds `IfAddr6` and supporting structures to represent IPv6 info
@izissise

Copy link
Copy Markdown
Contributor Author

Thanks for considering this change, I already did the CCA in 2022 see #641 (review)

@jart jart left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Right you are. Welcome back :) LGTM

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