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
{
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);
}