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
This commit is contained in:
Qing Li 2011-08-28 00:14:40 +00:00
parent 3e8e3c17cf
commit 1184509858
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=225223

View File

@ -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;
/*