From: Roy Marples Date: Thu, 16 Apr 2015 16:08:54 +0000 (+0000) Subject: Copy out some route types. X-Git-Tag: v6.8.2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c69a2af6eebf16264308ef16da04ab5e4207372;p=thirdparty%2Fdhcpcd.git Copy out some route types. --- diff --git a/if-linux.c b/if-linux.c index 51d8b742..d2669f1a 100644 --- a/if-linux.c +++ b/if-linux.c @@ -408,6 +408,11 @@ if_copyrt(struct dhcpcd_ctx *ctx, struct rt *rt, struct nlmsghdr *nlm) return -1; memset(rt, 0, sizeof(*rt)); + if (rtm->rtm_type == RTN_UNREACHABLE) + rt->flags = RTF_REJECT; + if (rtm->rtm_scope == RT_SCOPE_HOST) + rt->flags |= RTF_HOST; + prefsrc.s_addr = INADDR_ANY; rta = (struct rtattr *)RTM_RTA(rtm); len = RTM_PAYLOAD(nlm); @@ -468,9 +473,11 @@ if_copyrt6(struct dhcpcd_ctx *ctx, struct rt6 *rt, struct nlmsghdr *nlm) return -1; memset(rt, 0, sizeof(*rt)); - ipv6_mask(&rt->net, rtm->rtm_dst_len); if (rtm->rtm_type == RTN_UNREACHABLE) rt->flags = RTF_REJECT; + if (rtm->rtm_scope == RT_SCOPE_HOST) + rt->flags |= RTF_HOST; + ipv6_mask(&rt->net, rtm->rtm_dst_len); rta = (struct rtattr *)RTM_RTA(rtm); len = RTM_PAYLOAD(nlm);