]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If a host route in static routes, don't then set a netmask based on the route.
authorRoy Marples <roy@marples.name>
Wed, 18 Nov 2015 21:21:30 +0000 (21:21 +0000)
committerRoy Marples <roy@marples.name>
Wed, 18 Nov 2015 21:21:30 +0000 (21:21 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 0ee7295be0db74b51a714d97c24736d3f7da7117..0060286c0a01ce60c540ee913f91748f99e9958b 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -611,8 +611,9 @@ get_option_routes(struct interface *ifp, const struct dhcp_message *dhcp)
                        {
                                route->gate.s_addr = htonl(INADDR_ANY);
                                route->net.s_addr = htonl(INADDR_BROADCAST);
-                       }
-                       route->net.s_addr = route_netmask(route->dest.s_addr);
+                       } else
+                               route->net.s_addr =
+                                   route_netmask(route->dest.s_addr);
                        TAILQ_INSERT_TAIL(routes, route, next);
                }
        }