Skip to content

Commit cbcdce4

Browse files
Sime-Zupanovicrsmarples
authored andcommitted
Check context options if no interface options are setup.
If allows an interface to stop even if dhcpcd is not.
1 parent a78af8c commit cbcdce4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/dhcpcd.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,15 @@ dhcpcd_handlecarrier(struct interface *ifp, int carrier, unsigned int flags)
779779
ifp->carrier = carrier;
780780
ifp->flags = flags;
781781

782-
if (ifp->options->options & DHCPCD_STOPPING)
782+
/*
783+
* Inactive interfaces may not have options, we so check the
784+
* global context if we are stopping or not.
785+
* This allows an active interface to stop even if dhcpcd is not.
786+
*/
787+
if (ifp->options != NULL) {
788+
if (ifp->options->options & DHCPCD_STOPPING)
789+
return;
790+
} else if (ifp->ctx->options & DHCPCD_STOPPING)
783791
return;
784792

785793
if (!if_is_link_up(ifp)) {

0 commit comments

Comments
 (0)