]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
BSD handles a subnet route for addresses of /32.
authorRoy Marples <roy@marples.name>
Thu, 16 Apr 2015 16:08:24 +0000 (16:08 +0000)
committerRoy Marples <roy@marples.name>
Thu, 16 Apr 2015 16:08:24 +0000 (16:08 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index feb48d2702410c8ee81a5ed3d10e117d6a027484..9c5162c96c9681917eb7cf5b63090d0d33b198ed 100644 (file)
--- a/ipv4.c
+++ b/ipv4.c
@@ -445,9 +445,13 @@ add_subnet_route(struct rt_head *rt, const struct interface *ifp)
 
        s = D_CSTATE(ifp);
        /* Don't create a subnet route for these addresses */
-       if (s->net.s_addr == INADDR_BROADCAST ||
-           s->net.s_addr == INADDR_ANY)
+       if (s->net.s_addr == INADDR_ANY)
                return rt;
+#ifndef BSD
+       /* BSD adds a route in this instance */
+       if (s->net.s_addr == INADDR_BROADCAST)
+               return rt;
+#endif
 
        if ((r = malloc(sizeof(*r))) == NULL) {
                logger(ifp->ctx, LOG_ERR, "%s: %m", __func__);