From: Roy Marples Date: Thu, 20 Mar 2014 17:06:28 +0000 (+0000) Subject: Fix compile. X-Git-Tag: v6.4.0~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=439d6f2d7535e671fe2089bce6424a1ae9b2ff91;p=thirdparty%2Fdhcpcd.git Fix compile. --- diff --git a/if-linux.c b/if-linux.c index 13ace62b..5a61845f 100644 --- a/if-linux.c +++ b/if-linux.c @@ -35,6 +35,8 @@ #include #include +#include + /* Support older kernels */ #ifndef IFLA_WIRELESS # define IFLA_WIRELESS (IFLA_MASTER + 1) @@ -814,9 +816,7 @@ if_route6(const struct rt6 *rt, int action) add_attr_l(&nlm.hdr, sizeof(nlm), RTA_DST, &rt->dest.s6_addr, sizeof(rt->dest.s6_addr)); - /* If destination == gateway then don't add the gateway */ - if (!IN6_IS_ADDR_UNSPECIFIED(&rt->gate) && - !IN6_ARE_ADDR_EQUAL(&rt->dest, &rt->gate)) + if (action >= 0 && !IN6_IS_ADDR_UNSPECIFIED(&rt->gate)) add_attr_l(&nlm.hdr, sizeof(nlm), RTA_GATEWAY, &rt->gate.s6_addr, sizeof(rt->gate.s6_addr)); diff --git a/ipv6.c b/ipv6.c index 37a35bb7..0edb200d 100644 --- a/ipv6.c +++ b/ipv6.c @@ -786,8 +786,7 @@ desc_route(const char *cmd, const struct rt6 *rt) gate = inet_ntop(AF_INET6, &rt->gate.s6_addr, gatebuf, INET6_ADDRSTRLEN); if (IN6_ARE_ADDR_EQUAL(&rt->gate, &in6addr_any)) - syslog(LOG_INFO, "%s: %s %sroute to %s/%d", ifname, cmd, - rt->flags & RTF_REJECT ? "reject " : "", + syslog(LOG_INFO, "%s: %s route to %s/%d", ifname, cmd, dest, ipv6_prefixlen(&rt->net)); else if (IN6_ARE_ADDR_EQUAL(&rt->dest, &in6addr_any) && IN6_ARE_ADDR_EQUAL(&rt->net, &in6addr_any))