summaryrefslogtreecommitdiffstats
path: root/if-linux.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-13 10:48:48 +0000
committerRoy Marples <roy@marples.name>2008-09-13 10:48:48 +0000
commita43bdfa634a490856dc4e2deb4b66e008d3f9b9d (patch)
tree02df1d307dd5f1547b13c5c943e93c575f13887b /if-linux.c
parent441f7d159dbb8448f075e177f9c3770503fc6aa4 (diff)
downloaddhcpcd-a43bdfa634a490856dc4e2deb4b66e008d3f9b9d.tar.xz
Fix subnet route.
Diffstat (limited to 'if-linux.c')
-rw-r--r--if-linux.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/if-linux.c b/if-linux.c
index 4a9dd61b..803356cc 100644
--- a/if-linux.c
+++ b/if-linux.c
@@ -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;