]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile.
authorRoy Marples <roy@marples.name>
Thu, 20 Mar 2014 17:06:28 +0000 (17:06 +0000)
committerRoy Marples <roy@marples.name>
Thu, 20 Mar 2014 17:06:28 +0000 (17:06 +0000)
if-linux.c
ipv6.c

index 13ace62be725428cf191df42d56a82518cbf50b5..5a61845f489f7d7049c6b8057a7ade6556d1192e 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 
+#include <net/route.h>
+
 /* 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 37a35bb7e66fd9f4618526f36762ae15d4fd2922..0edb200dfa72a290585de80ae3ceacd38c559edf 100644 (file)
--- 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))