]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
BSD: Mark routes as static only from static config
authorRoy Marples <roy@marples.name>
Mon, 15 Jun 2020 08:49:34 +0000 (09:49 +0100)
committerRoy Marples <roy@marples.name>
Mon, 15 Jun 2020 08:49:34 +0000 (09:49 +0100)
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
src/if-sun.c

index 6851605293f01066d8d5fae9dbdc77f5625587db..b10017159ef370d87632d3482d0ddedac3d47bc5 100644 (file)
@@ -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) {
index 13dab3a30d493b96e1471bbba61657da0aadced4..4f5c164731a891f27876e04ddf5bac1655776a1a 100644 (file)
@@ -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) {