Skip to content

unix: Make network monitoring optional in getifaddrs() impl#164

Merged
icculus merged 1 commit into
libsdl-org:mainfrom
pinotree:getifaddrs-without-monitoring
May 24, 2026
Merged

unix: Make network monitoring optional in getifaddrs() impl#164
icculus merged 1 commit into
libsdl-org:mainfrom
pinotree:getifaddrs-without-monitoring

Conversation

@pinotree

Copy link
Copy Markdown
Contributor

While getifaddrs() is POSIX and its usage can be enabled on more platforms than the current set, network monitoring APIs are platform-specific.

Hence make the network monitoring optional, enabling it when either Netlink (Linux) or PF_ROUTE sockets (BSDs) is available. This gives to any other getifaddrs() platform a functional SDL_net, simply without updates to the available network interfaces after the first listing.

  • I confirm that I am the author of this code and release it to the SDL_net project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

While getifaddrs() is POSIX and its usage can be enabled on more
platforms than the current set, network monitoring APIs are
platform-specific.

Hence make the network monitoring optional, enabling it when either
Netlink (Linux) or PF_ROUTE sockets (BSDs) is available. This gives
to any other getifaddrs() platform a functional SDL_net, simply without
updates to the available network interfaces after the first listing.
@icculus

icculus commented May 24, 2026

Copy link
Copy Markdown
Collaborator

This is a good idea.

@icculus icculus merged commit be221fd into libsdl-org:main May 24, 2026
5 checks passed
@pinotree pinotree deleted the getifaddrs-without-monitoring branch May 24, 2026 16:25
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