changeset 973:5b59480a3a9b draft

Fix subnet route.
author Roy Marples <roy@marples.name>
date Sat, 13 Sep 2008 10:48:48 +0000
parents e61044370846
children a4e9cf36b477
files if-linux.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/if-linux.c	Fri Sep 12 18:08:07 2008 +0000
+++ b/if-linux.c	Sat Sep 13 10:48:48 2008 +0000
@@ -365,7 +365,8 @@
 	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;