diff options
author | dg <dg@FreeBSD.org> | 1995-05-03 07:16:53 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-03 07:16:53 +0000 |
commit | b8a73effc21450507bdf8cf8d37ad15034f747ef (patch) | |
tree | f1ffbe2f593b209cd9e2c3e3598d91796239f5e2 /sys/netinet/tcp_input.c | |
parent | f27748df161c0266fb30127814043fd64948def3 (diff) | |
download | FreeBSD-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/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index e97a986..84f903b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * From: @(#)tcp_input.c 8.5 (Berkeley) 4/10/94 - * $Id: tcp_input.c,v 1.20 1995/04/10 17:16:10 davidg Exp $ + * $Id: tcp_input.c,v 1.21 1995/04/10 17:37:46 davidg Exp $ */ #ifndef TUBA_INCLUDE @@ -337,7 +337,18 @@ tcp_input(m, iphlen) * Locate pcb for segment. */ findpcb: - inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport, ti->ti_dst, ti->ti_dport); + /* + * First look for an exact match. + */ + inp = in_pcblookuphash(&tcbinfo, ti->ti_src, ti->ti_sport, + ti->ti_dst, ti->ti_dport); + /* + * ...and if that fails, do a wildcard search. + */ + if (inp == NULL) { + inp = in_pcblookup(&tcb, ti->ti_src, ti->ti_sport, + ti->ti_dst, ti->ti_dport, INPLOOKUP_WILDCARD); + } /* * If the state is CLOSED (i.e., TCB does not exist) then @@ -345,7 +356,7 @@ findpcb: * If the TCB exists but is in CLOSED state, it is embryonic, * but should either do a listen or a connect soon. */ - if (inp == 0) + if (inp == NULL) goto dropwithreset; tp = intotcpcb(inp); if (tp == 0) |