]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcp: return routes when renewing
authorRoy Marples <roy@marples.name>
Thu, 18 May 2017 13:54:16 +0000 (14:54 +0100)
committerRoy Marples <roy@marples.name>
Thu, 6 Jul 2017 16:32:37 +0000 (17:32 +0100)
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

src/dhcp.c

index e83065b208ed176d9a5b511e850a5c124de311b1..a519a1830aee6b49d69e8e78d2a776ac687918d9 100644 (file)
@@ -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);
 }