summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-26 17:22:42 +0100
committerRoy Marples <roy@marples.name>2020-04-26 17:22:42 +0100
commit62094f1bd162e2a4cbaf21409c73904c6524927c (patch)
treee3fa39936e43669cbae76ca833532468f17ef29f /src/ipv6.c
parent88fe3a9b8586a356377a39b778094734949b643b (diff)
downloaddhcpcd-62094f1bd162e2a4cbaf21409c73904c6524927c.tar.xz
DHCP6: Implement DECLINE support for duplicated addresses
This is the final piece of DHCP6 to implement! Part of this change drops the use of the IPV6_AF_DUPLICATED flag and we just use IN6_IFF_DUPLICATED now.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index f6734e93..c039e7e6 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1635,7 +1635,7 @@ ipv6_staticdadcallback(void *arg)
wascompleted = (ia->flags & IPV6_AF_DADCOMPLETED);
ia->flags |= IPV6_AF_DADCOMPLETED;
- if (ia->flags & IPV6_AF_DUPLICATED)
+ if (ia->addr_flags & IN6_IFF_DUPLICATED)
logwarnx("%s: DAD detected %s", ia->iface->name,
ia->saddr);
else if (!wascompleted) {
@@ -1838,16 +1838,13 @@ ipv6_handleifa_addrs(int cmd,
}
break;
case RTM_NEWADDR:
+ ia->addr_flags = addr->addr_flags;
/* Safety - ignore tentative announcements */
- if (addr->addr_flags &
+ if (ia->addr_flags &
(IN6_IFF_DETACHED | IN6_IFF_TENTATIVE))
break;
if ((ia->flags & IPV6_AF_DADCOMPLETED) == 0) {
found++;
- if (addr->addr_flags & IN6_IFF_DUPLICATED)
- ia->flags |= IPV6_AF_DUPLICATED;
- else
- ia->flags &= ~IPV6_AF_DUPLICATED;
if (ia->dadcallback)
ia->dadcallback(ia);
/* We need to set this here in-case the
@@ -1890,7 +1887,7 @@ ipv6_tempdadcallback(void *arg)
{
struct ipv6_addr *ia = arg;
- if (ia->flags & IPV6_AF_DUPLICATED) {
+ if (ia->addr_flags & IN6_IFF_DUPLICATED) {
struct ipv6_addr *ia1;
struct timespec tv;