From: Roy Marples Date: Tue, 25 Jul 2017 09:14:06 +0000 (+0100) Subject: dhcpcd starts inactive interfaces erroneously. X-Git-Tag: v7.0.0-rc2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22559de85ae910ae3fe2b1d633c3113f01756a26;p=thirdparty%2Fdhcpcd.git dhcpcd starts inactive interfaces erroneously. Summary: If ifp->active is not IF_ACTIVE_USER only find DHCPv6 delegations for the interface on carrier up. Test Plan: Allow DHCP on all interfaces, but set one interface in denyinterfaces. Assign this interface a delegation from another interface. This interface should not start DHCP. Differential Revision: https://dev.marples.name/D120 --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 9c99cb76..4213c490 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -860,16 +860,19 @@ dhcpcd_startinterface(void *arg) ifo->options &= ~DHCPCD_IPV6; } if (ifo->options & DHCPCD_IPV6) { - ipv6_startstatic(ifp); + if (ifp->active == IF_ACTIVE_USER) { + ipv6_startstatic(ifp); - if (ifo->options & DHCPCD_IPV6RS) - ipv6nd_startrs(ifp); + if (ifo->options & DHCPCD_IPV6RS) + ipv6nd_startrs(ifp); + } if (ifo->options & DHCPCD_DHCP6) dhcp6_find_delegates(ifp); - if (!(ifo->options & DHCPCD_IPV6RS) || - ifo->options & (DHCPCD_IA_FORCED | DHCPCD_INFORM6)) + if ((!(ifo->options & DHCPCD_IPV6RS) || + ifo->options & (DHCPCD_IA_FORCED | DHCPCD_INFORM6)) && + ifp->active == IF_ACTIVE_USER) { ssize_t nolease; @@ -899,7 +902,7 @@ dhcpcd_startinterface(void *arg) } #ifdef INET - if (ifo->options & DHCPCD_IPV4) { + if (ifo->options & DHCPCD_IPV4 && ifp->active == IF_ACTIVE_USER) { /* Ensure we have an IPv4 state before starting DHCP */ if (ipv4_getstate(ifp) != NULL) dhcp_start(ifp);