diff options
| author | Roy Marples <roy@marples.name> | 2020-04-19 07:52:47 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-04-19 07:52:47 +0100 |
| commit | 628167b10574e83805b6a1b67b89ddc53ea231c5 (patch) | |
| tree | 8818de9458134307942c4ce943ec9d2a8cad28e4 /src/if-bsd.c | |
| parent | 9823ded7ab5c3ba2650274738763521e3e277666 (diff) | |
| download | dhcpcd-628167b10574e83805b6a1b67b89ddc53ea231c5.tar.xz | |
inet6: Add 'temporary' directive to the slaac option
This instructs dhcpcd to create a temporary address for each
address generated from a RA.
As such, dhcpcd no longer looks at the kernel option for it
as the functionality is being removed from some or never existed
in the first place.
Diffstat (limited to 'src/if-bsd.c')
| -rw-r--r-- | src/if-bsd.c | 79 |
1 files changed, 1 insertions, 78 deletions
diff --git a/src/if-bsd.c b/src/if-bsd.c index 7361669a..973fca1a 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -1626,7 +1626,6 @@ if_machinearch(char *str, size_t len) #ifdef INET6 #if (defined(IPV6CTL_ACCEPT_RTADV) && !defined(ND6_IFF_ACCEPT_RTADV)) || \ - defined(IPV6CTL_USETEMPADDR) || defined(IPV6CTL_TEMPVLTIME) || \ defined(IPV6CTL_FORWARDING) #define get_inet6_sysctl(code) inet6_sysctl(code, 0, 0) #define set_inet6_sysctl(code, val) inet6_sysctl(code, val, 1) @@ -1687,8 +1686,7 @@ if_applyra(const struct ra *rap) #endif } -#ifdef IPV6_MANAGETEMPADDR -#if !defined(IPV6CTL_TEMPVLTIME) && !defined(__OpenBSD__) +#ifndef IPV6CTL_FORWARDING #define get_inet6_sysctlbyname(code) inet6_sysctlbyname(code, 0, 0) #define set_inet6_sysctlbyname(code, val) inet6_sysctlbyname(code, val, 1) static int @@ -1708,81 +1706,6 @@ inet6_sysctlbyname(const char *name, int val, int action) } #endif -#ifdef __OpenBSD__ -int -ip6_use_tempaddr(const char *ifname) -{ - int s, r; - struct ifreq ifr; - - s = socket(PF_INET6, SOCK_DGRAM, 0); /* XXX Not efficient */ - if (s == -1) - return -1; - strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - r = ioctl(s, SIOCGIFXFLAGS, &ifr); - close(s); - if (r == -1) - return -1; - return ifr.ifr_flags & IFXF_INET6_NOPRIVACY ? 0 : 1; -} - -int -ip6_temp_preferred_lifetime(__unused const char *ifname) -{ - - return TEMP_PREFERRED_LIFETIME; -} - -int -ip6_temp_valid_lifetime(__unused const char *ifname) -{ - - return TEMP_VALID_LIFETIME; -} - -#else /* __OpenBSD__ */ - -int -ip6_use_tempaddr(__unused const char *ifname) -{ - int val; - -#ifdef IPV6CTL_USETEMPADDR - val = get_inet6_sysctl(IPV6CTL_USETEMPADDR); -#else - val = get_inet6_sysctlbyname("net.inet6.ip6.use_tempaddr"); -#endif - return val == -1 ? 0 : val; -} - -int -ip6_temp_preferred_lifetime(__unused const char *ifname) -{ - int val; - -#ifdef IPV6CTL_TEMPPLTIME - val = get_inet6_sysctl(IPV6CTL_TEMPPLTIME); -#else - val = get_inet6_sysctlbyname("net.inet6.ip6.temppltime"); -#endif - return val < 0 ? TEMP_PREFERRED_LIFETIME : val; -} - -int -ip6_temp_valid_lifetime(__unused const char *ifname) -{ - int val; - -#ifdef IPV6CTL_TEMPVLTIME - val = get_inet6_sysctl(IPV6CTL_TEMPVLTIME); -#else - val = get_inet6_sysctlbyname("net.inet6.ip6.tempvltime"); -#endif - return val < 0 ? TEMP_VALID_LIFETIME : val; -} -#endif /* !__OpenBSD__ */ -#endif - int ip6_forwarding(__unused const char *ifname) { |
