From db2e7690c98a3e4c70c71ebfd48e16dc0949daaf Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 15 Jun 2020 09:49:34 +0100 Subject: [PATCH] BSD: Mark routes as static only from static config Rather than if genered by an address. This allows RA prefix routes without an address to be non static, so you could derive whether a route came from something autoconf or not. --- src/if-bsd.c | 4 +--- src/if-sun.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/if-bsd.c b/src/if-bsd.c index 68516052..b1001715 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -727,9 +727,7 @@ if_route(unsigned char cmd, const struct rt *rt) } else rtm->rtm_flags |= RTF_GATEWAY; - /* Emulate the kernel by marking address generated - * network routes non-static. */ - if (!(rt->rt_dflags & RTDF_IFA_ROUTE)) + if (rt->rt_dflags & RTDF_STATIC) rtm->rtm_flags |= RTF_STATIC; if (rt->rt_mtu != 0) { diff --git a/src/if-sun.c b/src/if-sun.c index 13dab3a3..4f5c1647 100644 --- a/src/if-sun.c +++ b/src/if-sun.c @@ -594,9 +594,7 @@ if_route0(struct dhcpcd_ctx *ctx, struct rtm *rtmsg, else if (!gateway_unspec) rtm->rtm_flags |= RTF_GATEWAY; - /* Emulate the kernel by marking address generated - * network routes non-static. */ - if (!(rt->rt_dflags & RTDF_IFA_ROUTE)) + if (rt->rt_dflags & RTDF_STATIC) rtm->rtm_flags |= RTF_STATIC; if (rt->rt_mtu != 0) { -- 2.47.2