From: Roy Marples Date: Wed, 25 Oct 2017 10:45:25 +0000 (+0100) Subject: ipv6nd: don't handle NA or RA if not active interface X-Git-Tag: v7.0.0-rc4~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3479ca7740a164537b583531b7f779e8e418d30e;p=thirdparty%2Fdhcpcd.git ipv6nd: don't handle NA or RA if not active interface This stops interfaces activated only for delegating to from receiving these messages by default. --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 4b2127ff..a35381f7 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -1559,15 +1559,18 @@ ipv6nd_handledata(void *arg) return; } + /* Find the receiving interface */ TAILQ_FOREACH(ifp, ctx->ifaces, next) { - if (ifp->active && - ifp->index == (unsigned int)pkt.ipi6_ifindex) { - if (!(ifp->options->options & DHCPCD_IPV6)) - return; + if (ifp->index == (unsigned int)pkt.ipi6_ifindex) break; - } } + /* Don't do anything if the user hasn't configured it. */ + if (ifp != NULL && + (ifp->active != IF_ACTIVE_USER || + !(ifp->options->options & DHCPCD_IPV6))) + return; + icp = (struct icmp6_hdr *)ctx->rcvhdr.msg_iov[0].iov_base; if (icp->icmp6_code == 0) { switch(icp->icmp6_type) {