o To prevent a race between RTM_DELETE message and

arptimer() deleting stale entry, we need to lock
  rtentry before unlocking radix head.

Reviewed by:	sam
This commit is contained in:
glebius 2005-08-11 08:26:31 +00:00
parent c7fa71afc5
commit eff02aa90f

View File

@ -428,11 +428,13 @@ route_output(struct mbuf *m, struct socket *so)
RADIX_NODE_HEAD_LOCK(rnh);
rt = (struct rtentry *) rnh->rnh_lookup(info.rti_info[RTAX_DST],
info.rti_info[RTAX_NETMASK], rnh);
RADIX_NODE_HEAD_UNLOCK(rnh);
if (rt == NULL) /* XXX looks bogus */
if (rt == NULL) { /* XXX looks bogus */
RADIX_NODE_HEAD_UNLOCK(rnh);
senderr(ESRCH);
}
RT_LOCK(rt);
RT_ADDREF(rt);
RADIX_NODE_HEAD_UNLOCK(rnh);
/*
* Fix for PR: 82974