From: Roy Marples Date: Mon, 15 Jun 2020 08:49:34 +0000 (+0100) Subject: BSD: Mark routes as static only from static config X-Git-Tag: v9.1.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db2e7690c98a3e4c70c71ebfd48e16dc0949daaf;p=thirdparty%2Fdhcpcd.git 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. --- 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) {