diff options
| author | Roy Marples <roy@marples.name> | 2014-02-12 20:51:57 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-02-12 20:51:57 +0000 |
| commit | 2433e54dc8af1bc7c199e0a776a71c6cedd1e10b (patch) | |
| tree | ea8674d4bba14e6df02a2eac2a43d8f52c277d6e /ipv6nd.c | |
| parent | d733d75a89f3ef0f320be981d814cbf480862cfe (diff) | |
| download | dhcpcd-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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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) { |
