diff options
author | 2005-10-17 08:43:34 +0000 | |
---|---|---|
committer | 2005-10-17 08:43:34 +0000 | |
commit | 4733c93dc38d790f544e8f0ac18157429e138835 (patch) | |
tree | 65676727e08ec6c2ec4fa67e67cf8dbbf4a88584 /sys/netinet/tcp_input.c | |
parent | sync with heimdal 0.7 (diff) | |
download | wireguard-openbsd-4733c93dc38d790f544e8f0ac18157429e138835.tar.xz wireguard-openbsd-4733c93dc38d790f544e8f0ac18157429e138835.zip |
make pf use one mbuf tag instead of 6 distinct ones. use a little struct
in the data part for the data from the previously distinct tags.
look up the tag early and carry a pointer to it around.
makes the code easier and saves some tag lookups and thus helps performance,
as proven by tests run by Schberle Dniel <Schoeberle.Daniel@aamtech.hu>
Initially hacked up somewhere over the atlantic ocean in an A330
early testing reyk and moritz, "put it in" theo
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 71ff36cf3df..d95fd196561 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.190 2005/08/11 11:39:36 markus Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.191 2005/10/17 08:43:34 henning Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -604,19 +604,25 @@ findpcb: break; } if (inp == 0) { + int inpl_flags = 0; +#if NPF > 0 + struct pf_mtag *t; + + if ((t = pf_find_mtag(m)) != NULL && + t->flags & PF_TAG_TRANSLATE_LOCALHOST) + inpl_flags = INPLOOKUP_WILDCARD; +#endif ++tcpstat.tcps_pcbhashmiss; switch (af) { #ifdef INET6 case AF_INET6: inp = in6_pcblookup_listen(&tcbtable, - &ip6->ip6_dst, th->th_dport, m_tag_find(m, - PACKET_TAG_PF_TRANSLATE_LOCALHOST, NULL) != NULL); + &ip6->ip6_dst, th->th_dport, inpl_flags); break; #endif /* INET6 */ case AF_INET: inp = in_pcblookup_listen(&tcbtable, - ip->ip_dst, th->th_dport, m_tag_find(m, - PACKET_TAG_PF_TRANSLATE_LOCALHOST, NULL) != NULL); + ip->ip_dst, th->th_dport, inpl_flags); break; } /* |