summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-07-25 10:14:06 +0100
committerRoy Marples <roy@marples.name>2017-07-25 10:17:06 +0100
commit20690fe51f2837e71889f3669169584aed043ed8 (patch)
tree82b17a0294ae4aadf99f47de5848fe32d5d41c11 /src/dhcpcd.c
parent34755e92eb1838489b902d77d13c928b6cc8dfea (diff)
downloaddhcpcd-20690fe51f2837e71889f3669169584aed043ed8.tar.xz
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
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c15
1 files changed, 9 insertions, 6 deletions
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);