Remove the reference held on the loopback route when the interface

address is being deleted. Only the last reference holder deletes the
loopback route. All other delete operations just clear the IFA_RTSELF
flag.

PR:		kern/159601
Submitted by:	pluknet
Reviewed by:	discussed on net@
MFC after:	3 days
This commit is contained in:
qingli 2011-10-07 18:01:34 +00:00
parent f1deb54a54
commit d0874dfb45

View File

@ -1126,8 +1126,10 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags)
RT_LOCK(ia_ro.ro_rt);
if (ia_ro.ro_rt->rt_refcnt <= 1)
freeit = 1;
else
else if (flags & LLE_STATIC) {
RT_REMREF(ia_ro.ro_rt);
target->ia_flags &= ~IFA_RTSELF;
}
RTFREE_LOCKED(ia_ro.ro_rt);
}
if (freeit && (flags & LLE_STATIC)) {