PERFORCE change 126491 for review
Kip Macy
kmacy at FreeBSD.org
Sun Sep 16 15:03:00 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126491
Change 126491 by kmacy at kmacy_home:ethng on 2007/09/16 22:02:56
avoid the extra lock acquisitions incurred by rt_check
if the interface is up and the gateway is set
Affected files ...
.. //depot/projects/ethng/src/sys/netinet/if_ether.c#3 edit
Differences ...
==== //depot/projects/ethng/src/sys/netinet/if_ether.c#3 (text+ko) ====
@@ -358,7 +358,7 @@
struct llinfo_arp *la = NULL;
struct rtentry *rt = NULL;
struct sockaddr_dl *sdl;
- int error;
+ int error = 0;
if (m->m_flags & M_BCAST) { /* broadcast */
(void)memcpy(desten, ifp->if_broadcastaddr, ifp->if_addrlen);
@@ -370,7 +370,11 @@
}
if (rt0 != NULL) {
- error = rt_check(&rt, &rt0, dst);
+ if (((rt0->rt_flags && RTF_UP) == 0) ||
+ ((rt0->rt_flags & RTF_GATEWAY) && (rt0->rt_gateway == NULL)))
+ error = rt_check(&rt, &rt0, dst);
+ else
+ rt = rt0;
if (error) {
m_freem(m);
return error;
More information about the p4-projects
mailing list