From: Roy Marples Date: Mon, 9 Oct 2017 18:57:09 +0000 (+0100) Subject: Set RA routes as RA in supported OS's. X-Git-Tag: v7.0.0-rc4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a99a8a279a8924aa2ac84811685d5a2c7f3719f4;p=thirdparty%2Fdhcpcd.git Set RA routes as RA in supported OS's. --- diff --git a/src/if-linux.c b/src/if-linux.c index 9f030cef..debbabaa 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -1221,6 +1221,11 @@ if_route(unsigned char cmd, const struct rt *rt) } else { /* Address generated routes are RTPROT_KERNEL, * otherwise RTPROT_BOOT */ +#ifdef RTPROT_RA + if (rt->rt_dflags & RTDF_RA) + nlm.rt.rtm_protocol = RTPROT_RA; + else +#endif if (rt->rt_dflags & RTDF_IFA_ROUTE) nlm.rt.rtm_protocol = RTPROT_KERNEL; else diff --git a/src/ipv6.c b/src/ipv6.c index 2b9dba3a..a9543dd6 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -2136,8 +2136,10 @@ inet6_makeroute(struct interface *ifp, const struct ra *rap) #ifdef HAVE_ROUTE_METRIC rt->rt_metric = ifp->metric; #endif - if (rap != NULL) + if (rap != NULL) { rt->rt_mtu = rap->mtu; + rt->rt_dflags |= RTDF_RA; + } return rt; } diff --git a/src/route.h b/src/route.h index d203c669..ec4ea1c3 100644 --- a/src/route.h +++ b/src/route.h @@ -72,9 +72,10 @@ struct rt { unsigned int rt_metric; #endif unsigned int rt_dflags; -#define RTDF_INIT 0x01 /* Generated by if_initrt() */ -#define RTDF_IFA_ROUTE 0x02 /* Address generated route */ -#define RTDF_FAKE 0x04 /* Maybe us on lease reboot */ +#define RTDF_INIT 0x01 /* Generated by if_initrt() */ +#define RTDF_IFA_ROUTE 0x02 /* Address generated route */ +#define RTDF_FAKE 0x04 /* Maybe us on lease reboot */ +#define RTDF_RA 0x08 /* Router Advertisement */ }; TAILQ_HEAD(rt_head, rt);