From: Nuno Antunes Date: Mon, 11 Feb 2008 16:42:39 +0000 (+0000) Subject: Fix arprequest serialization. X-Git-Tag: v2.0.1~1125 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/9c94ab977d6caf26f57517091ff37520d9896f8e Fix arprequest serialization. arprequest() calls ifp->if_output() without locally grabbing the respective serializer, so ASSERT_SERIALIZED at the beginning of the function. Grab the serializer at arp_rtrequest() when it calls arprequest(). Reviewed-by: sephe@ --- diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b85cb0336c..069c45e403 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -64,7 +64,7 @@ * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/netinet/if_ether.c,v 1.64.2.23 2003/04/11 07:23:15 fjoe Exp $ - * $DragonFly: src/sys/netinet/if_ether.c,v 1.43 2007/09/08 12:35:04 sephe Exp $ + * $DragonFly: src/sys/netinet/if_ether.c,v 1.44 2008/02/11 16:42:39 nant Exp $ */ /* @@ -223,11 +223,14 @@ arp_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) break; } /* Announce a new entry if requested. */ - if (rt->rt_flags & RTF_ANNOUNCE) + if (rt->rt_flags & RTF_ANNOUNCE) { + lwkt_serialize_enter(rt->rt_ifp->if_serializer); arprequest(rt->rt_ifp, &SIN(rt_key(rt))->sin_addr, &SIN(rt_key(rt))->sin_addr, LLADDR(SDL(gate))); + lwkt_serialize_exit(rt->rt_ifp->if_serializer); + } /*FALLTHROUGH*/ case RTM_RESOLVE: if (gate->sa_family != AF_LINK || @@ -324,6 +327,8 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip, struct sockaddr sa; u_short ar_hrd; + ASSERT_SERIALIZED(ifp->if_serializer); + if ((m = m_gethdr(MB_DONTWAIT, MT_DATA)) == NULL) return; m->m_pkthdr.rcvif = (struct ifnet *)NULL;