]> git.meshlink.io Git - meshlink/commitdiff
Use bind() to check if a local address is still valid.
authorGuus Sliepen <guus@meshlink.io>
Thu, 6 Feb 2020 20:34:43 +0000 (21:34 +0100)
committerGuus Sliepen <guus@meshlink.io>
Sat, 8 Feb 2020 14:00:39 +0000 (15:00 +0100)
Some platforms don't support getifaddrs(). We use this to check if the
local address of a socket is still available on any network interface.
Instead, try to bind() a new socket to the same address (but port 0) as
existing sockets. If it returns EADDRNOTAVAIL, we know that this address
is no longer valid.


No differences found