]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add loopback support for Linux.
authorRoy Marples <roy@marples.name>
Wed, 19 Jun 2013 16:11:31 +0000 (16:11 +0000)
committerRoy Marples <roy@marples.name>
Wed, 19 Jun 2013 16:11:31 +0000 (16:11 +0000)
if-linux.c

index 4882e2e237a36344162af5ca596ee0485d3232a3..6ec6d00462ff1c18b33517d3077b347ae26ce6c8 100644 (file)
@@ -632,8 +632,10 @@ if_route(const struct rt *rt, int action)
                add_attr_l(&nlm->hdr, sizeof(*nlm), RTA_GATEWAY,
                    &rt->gate.s_addr, sizeof(rt->gate.s_addr));
 
-       add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_OIF, rt->iface->index);
-       add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_PRIORITY, rt->metric);
+       if (rt->gate.s_addr != htonl(INADDR_LOOPBACK)) {
+               add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_OIF, rt->iface->index);
+               add_attr_32(&nlm->hdr, sizeof(*nlm), RTA_PRIORITY, rt->metric);
+       }
 
        if (send_netlink(&nlm->hdr) == -1)
                retval = -1;