From d25c0262b0b235937f1f7784cb1743a64be052a3 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 21 Nov 2025 11:26:32 +0000 Subject: [PATCH 1/2] IPv4: Ignore DHCP state when building routes As this will change periodically. We only care if the state (address) has been added. Fixes #440 thanks to JognSmit. --- src/ipv4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipv4.c b/src/ipv4.c index bc7e3634..fc1640cf 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -291,7 +291,7 @@ inet_dhcproutes(rb_tree_t *routes, struct interface *ifp, bool *have_default) int n; state = D_CSTATE(ifp); - if (state == NULL || state->state != DHS_BOUND || !state->added) + if (state == NULL || !(state->added & STATE_ADDED)) return 0; /* An address does have to exist. */ From 9bb6f5df7460c738a944fa3486f1d13e621a4978 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 3 Dec 2025 11:22:40 +0000 Subject: [PATCH 2/2] Set the fake flag on the route if the added state is fake --- src/ipv4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipv4.c b/src/ipv4.c index fc1640cf..4137e326 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -359,6 +359,8 @@ inet_dhcproutes(rb_tree_t *routes, struct interface *ifp, bool *have_default) rt->rt_mtu = mtu; if (!(rt->rt_dflags & RTDF_STATIC)) rt->rt_dflags |= RTDF_DHCP; + if (state->added & STATE_FAKE) + rt->rt_dflags |= RTDF_FAKE; sa_in_init(&rt->rt_ifa, &state->addr->addr); if (rb_tree_insert_node(routes, rt) != rt) { rt_free(rt);