summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-03 07:16:53 +0000
committerdg <dg@FreeBSD.org>1995-05-03 07:16:53 +0000
commitb8a73effc21450507bdf8cf8d37ad15034f747ef (patch)
treef1ffbe2f593b209cd9e2c3e3598d91796239f5e2 /sys/netinet/in_pcb.c
parentf27748df161c0266fb30127814043fd64948def3 (diff)
downloadFreeBSD-src-b8a73effc21450507bdf8cf8d37ad15034f747ef.zip
FreeBSD-src-b8a73effc21450507bdf8cf8d37ad15034f747ef.tar.gz
Changed in_pcblookuphash() to not automatically call in_pcblookup() if
the lookup fails. Updated callers to deal with this. Call in_pcblookuphash instead of in_pcblookup() in in_pcbconnect; this improves performance of UDP output by about 17% in the standard case.
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 3a4c552..16dabf7 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in_pcb.c 8.2 (Berkeley) 1/4/94
- * $Id: in_pcb.c,v 1.9 1995/04/09 01:29:18 davidg Exp $
+ * $Id: in_pcb.c,v 1.10 1995/04/10 08:52:45 davidg Exp $
*/
#include <sys/param.h>
@@ -303,12 +303,9 @@ in_pcbconnect(inp, nam)
if (error = in_pcbladdr(inp, nam, &ifaddr))
return(error);
- if (in_pcblookup(inp->inp_pcbinfo->listhead,
- sin->sin_addr,
- sin->sin_port,
+ if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
- inp->inp_lport,
- 0))
+ inp->inp_lport) != NULL)
return (EADDRINUSE);
if (inp->inp_laddr.s_addr == INADDR_ANY) {
if (inp->inp_lport == 0)
@@ -588,17 +585,10 @@ in_pcblookuphash(pcbinfo, faddr, fport_arg, laddr, lport_arg)
LIST_REMOVE(inp, inp_hash);
LIST_INSERT_HEAD(head, inp, inp_hash);
}
- splx(s);
- return (inp);
+ break;
}
splx(s);
-
- /*
- * Didn't find an exact match, so try again looking for a matching
- * wildcard PCB.
- */
- return (in_pcblookup(pcbinfo->listhead, faddr, fport_arg, laddr,
- lport_arg, INPLOOKUP_WILDCARD));
+ return (inp);
}
/*
OpenPOWER on IntegriCloud