summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2011-08-28 00:14:40 +0000
committerqingli <qingli@FreeBSD.org>2011-08-28 00:14:40 +0000
commitf4bcd9de08c09f4fb9756e3763f837ada9ada98f (patch)
treedff4520fa8736c7007ebbbad11460e2f0b75bc4f /sys/netinet
parentba525096203a736ac44f9aa6d7148fe49dce0dd3 (diff)
downloadFreeBSD-src-f4bcd9de08c09f4fb9756e3763f837ada9ada98f.zip
FreeBSD-src-f4bcd9de08c09f4fb9756e3763f837ada9ada98f.tar.gz
When an interface address route is removed from the system, another
route with the same prefix is searched for as a replacement. The current code did not bypass routes that have non-operational interfaces. This patch fixes that bug and will find a replacement route with an active interface. PR: kern/159603 Submitted by: pluknet, ambrisko at ambrisko dot com Reviewed by: discussed on net@ Approved by: re (bz) MFC after: 3 days
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index e797c40..4547e39 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1163,7 +1163,8 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags)
p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
}
- if (prefix.s_addr != p.s_addr)
+ if ((prefix.s_addr != p.s_addr) ||
+ !(ia->ia_ifp->if_flags & IFF_UP))
continue;
/*
OpenPOWER on IntegriCloud