summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2018-06-02 10:27:45 +0100
committerRoy Marples <roy@marples.name>2018-06-02 10:27:45 +0100
commit486647eb1e3c66f9146be48f5710fdda524ed989 (patch)
tree1a38cfeee8f824ffcf6f5c3663014c733bf70f2b /src/ipv6.c
parent98eb1c33b239623cc19c13a51fec6d6910881ce5 (diff)
downloaddhcpcd-486647eb1e3c66f9146be48f5710fdda524ed989.tar.xz
ip6: if forked from ia callback, don't run ia handlers
It's pointless and resolves an issue where the handler would try and listen to an address when not in master mode, but it's already listened to in the child.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 82cf71b6..3085b888 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -1152,8 +1152,11 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx,
}
#endif
- if (ia->dadcallback)
+ if (ia->dadcallback) {
ia->dadcallback(ia);
+ if (ctx->options & DHCPCD_FORKED)
+ goto out;
+ }
if (IN6_IS_ADDR_LINKLOCAL(&ia->addr) &&
!(ia->addr_flags & IN6_IFF_NOTUSEABLE))
@@ -1168,20 +1171,24 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx,
cb, next);
cb->callback(cb->arg);
free(cb);
+ if (ctx->options & DHCPCD_FORKED)
+ goto out;
}
}
}
break;
}
- if (ia != NULL) {
- ipv6nd_handleifa(cmd, ia, pid);
- dhcp6_handleifa(cmd, ia, pid);
+ if (ia == NULL)
+ return;
- /* Done with the ia now, so free it. */
- if (cmd == RTM_DELADDR)
- ipv6_freeaddr(ia);
- }
+ ipv6nd_handleifa(cmd, ia, pid);
+ dhcp6_handleifa(cmd, ia, pid);
+
+out:
+ /* Done with the ia now, so free it. */
+ if (cmd == RTM_DELADDR)
+ ipv6_freeaddr(ia);
}
int