mirror of
https://github.com/neocturne/fastd.git
synced 2025-05-15 12:45:09 +02:00
Test interface flags for resolved LL6 address if on Linux
1) The resolved LL6 address of an interface for automatic configuration of an interface may be tentative (privacy extensions, etc.) and/or have failed DAD. Make sure to evaluate the address flags at least on Linux where this is possible.
This commit is contained in:
parent
89138834ed
commit
9924f756a1
3 changed files with 12 additions and 0 deletions
|
@ -52,6 +52,9 @@
|
||||||
/** Defined if the platform supports IP_PKTINFO */
|
/** Defined if the platform supports IP_PKTINFO */
|
||||||
#mesondefine USE_PKTINFO
|
#mesondefine USE_PKTINFO
|
||||||
|
|
||||||
|
/** Defined if the platform support IFA_F_* for address types */
|
||||||
|
#mesondefine USE_IFAFLAGS
|
||||||
|
|
||||||
/** Defined if the platform supports SO_MARK */
|
/** Defined if the platform supports SO_MARK */
|
||||||
#mesondefine USE_PACKET_MARK
|
#mesondefine USE_PACKET_MARK
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,10 @@
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef USE_IFAFLAGS
|
||||||
|
#include <linux/if_addr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** The global configuration */
|
/** The global configuration */
|
||||||
fastd_config_t conf = {};
|
fastd_config_t conf = {};
|
||||||
|
@ -138,6 +142,10 @@ static void normalize_address(fastd_peer_address_t *address, const fastd_peer_ad
|
||||||
const fastd_peer_address_t *addr = (const fastd_peer_address_t *)ifa->ifa_addr;
|
const fastd_peer_address_t *addr = (const fastd_peer_address_t *)ifa->ifa_addr;
|
||||||
if (!fastd_peer_address_is_v6_ll(addr))
|
if (!fastd_peer_address_is_v6_ll(addr))
|
||||||
continue;
|
continue;
|
||||||
|
#ifdef USE_IFAFLAGS
|
||||||
|
if ((ifa->ifa_flags & IFA_F_DEPRECATED) || (ifa->ifa_flags & IFA_F_DADFAILED))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
address->in6 = addr->in6;
|
address->in6 = addr->in6;
|
||||||
address->in6.sin6_port = config->in6.sin6_port;
|
address->in6.sin6_port = config->in6.sin6_port;
|
||||||
|
|
|
@ -192,6 +192,7 @@ conf_data.set('HAVE_SETRESGID',
|
||||||
|
|
||||||
conf_data.set('USE_BINDTODEVICE', is_android or is_linux)
|
conf_data.set('USE_BINDTODEVICE', is_android or is_linux)
|
||||||
conf_data.set('USE_EPOLL', is_android or is_linux)
|
conf_data.set('USE_EPOLL', is_android or is_linux)
|
||||||
|
conf_data.set('USE_IFAFLAGS', is_linux)
|
||||||
conf_data.set('USE_SELECT', is_darwin)
|
conf_data.set('USE_SELECT', is_darwin)
|
||||||
conf_data.set('USE_FREEBIND', is_android or is_linux)
|
conf_data.set('USE_FREEBIND', is_android or is_linux)
|
||||||
conf_data.set('USE_FREEBIND6', cc.has_header_symbol('netinet/in.h', 'IPV6_FREEBIND'))
|
conf_data.set('USE_FREEBIND6', cc.has_header_symbol('netinet/in.h', 'IPV6_FREEBIND'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue