From: Roy Marples Date: Thu, 18 May 2017 13:54:16 +0000 (+0100) Subject: dhcp: return routes when renewing X-Git-Tag: v7.0.0-rc2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bd58f2c3d4a0b5952e6f4ece50991537758d6c0;p=thirdparty%2Fdhcpcd.git dhcp: return routes when renewing Summary: If we only return our routes in the BOUND state, our working routes could be deleted if we're in the RENEWING state and another interface applies it's routes. Fixes T118. Test Plan: start dhcpcd on two interfaces and ensure both get a lease kill the DHCP server an one interface and wait for renewal. when one interface renews, no routes should be deleted. Reviewers: werebear77 Subscribers: werebear77 Maniphest Tasks: T118 Differential Revision: https://dev.marples.name/D113 --- diff --git a/src/dhcp.c b/src/dhcp.c index e83065b2..a519a183 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -697,7 +697,7 @@ dhcp_get_routes(struct rt_head *routes, struct interface *ifp) { const struct dhcp_state *state; - if ((state = D_CSTATE(ifp)) == NULL || state->state != DHS_BOUND) + if ((state = D_CSTATE(ifp)) == NULL || !(state->added & STATE_ADDED)) return 0; return get_option_routes(routes, ifp, state->new, state->new_len); }