summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-02-12 20:51:57 +0000
committerRoy Marples <roy@marples.name>2014-02-12 20:51:57 +0000
commit2433e54dc8af1bc7c199e0a776a71c6cedd1e10b (patch)
treeea8674d4bba14e6df02a2eac2a43d8f52c277d6e /ipv6nd.c
parentd733d75a89f3ef0f320be981d814cbf480862cfe (diff)
downloaddhcpcd-2433e54dc8af1bc7c199e0a776a71c6cedd1e10b.tar.xz
Ensure we close the contol socket if we fail to connect.
Don't crash when closing IPv6ND or DHCPv6 when not the IPv6 protocol is not started.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index 8b8f52fa..acc2699f 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -999,9 +999,11 @@ ipv6nd_has_ra(const struct interface *ifp)
{
const struct ra *rap;
- TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next)
- if (rap->iface == ifp)
- return 1;
+ if (ifp->ctx->ipv6) {
+ TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next)
+ if (rap->iface == ifp)
+ return 1;
+ }
return 0;
}
@@ -1227,6 +1229,9 @@ ipv6nd_drop(struct interface *ifp)
int expired = 0;
TAILQ_HEAD(rahead, ra) rtrs;
+ if (ifp->ctx->ipv6 == NULL)
+ return;
+
eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
TAILQ_INIT(&rtrs);
TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next) {