summaryrefslogtreecommitdiffstats
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
commit304a2790ced65da00324b525e4e8edb3b2af9345 (patch)
tree1a38cfeee8f824ffcf6f5c3663014c733bf70f2b
parentf02a620860eb68bd36d498da25c659539e2cac25 (diff)
downloaddhcpcd-304a2790ced65da00324b525e4e8edb3b2af9345.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.
-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