]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix subnet route.
authorRoy Marples <roy@marples.name>
Sat, 13 Sep 2008 10:48:48 +0000 (10:48 +0000)
committerRoy Marples <roy@marples.name>
Sat, 13 Sep 2008 10:48:48 +0000 (10:48 +0000)
if-linux.c

index 4a9dd61bacc6247d40889460fcccc1d1281e75b5..803356ccb727246738d1f9fd06a75c6831f77e36 100644 (file)
@@ -365,7 +365,8 @@ if_route(const struct interface *iface,
        else {
                nlm->hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL;
                /* We only change route metrics for kernel routes */
-               if (action == 0 && netmask->s_addr == iface->net.s_addr)
+               if (destination->s_addr == (iface->addr.s_addr & iface->net.s_addr) &&
+                   netmask->s_addr == iface->net.s_addr)
                        nlm->rt.rtm_protocol = RTPROT_KERNEL;
                else
                        nlm->rt.rtm_protocol = RTPROT_BOOT;