summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-28 16:39:48 +0000
committerRoy Marples <roy@marples.name>2020-04-28 16:39:48 +0000
commitd92c6f4eabd68c8a652c1e53ff5cf3bcc2bc042a (patch)
tree59b562097b1afda42eae1c8ecfcd6dbe093f544e /src
parentabf63a1f49fa3bc7faa009267ce0e38e3148306f (diff)
downloaddhcpcd-d92c6f4eabd68c8a652c1e53ff5cf3bcc2bc042a.tar.xz
DHCP: Close sockets on carrier down
This allows any BPF filter to reset family on carrier up.
Diffstat (limited to 'src')
-rw-r--r--src/dhcp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index 9af2dbd0..927f2137 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -2772,6 +2772,10 @@ dhcp_drop(struct interface *ifp, const char *reason)
dhcp_auth_reset(&state->auth);
#endif
+ /* Close DHCP ports so a changed interface family is picked
+ * up by a new BPF state. */
+ dhcp_close(ifp);
+
state->state = DHS_NONE;
free(state->offer);
state->offer = NULL;