summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2013-03-29 20:51:44 +0000
committeremaste <emaste@FreeBSD.org>2013-03-29 20:51:44 +0000
commit35fe5219abd995454f3d1279b840072f555159c3 (patch)
tree03bb2df2e5abb9ae4e6339ef2582ed6be37d70c0 /sys/netinet/tcp_input.c
parent2128397eaf648b65e295eba2a5b4f2d9dcc3640b (diff)
downloadFreeBSD-src-35fe5219abd995454f3d1279b840072f555159c3.zip
FreeBSD-src-35fe5219abd995454f3d1279b840072f555159c3.tar.gz
Keep fwd_tag around for subsequent pcb lookups
For TIMEWAIT handling tcp_input may have to jump back for an additional pass through pcblookup. Prior to this change the fwd_tag had been discarded after the first lookup, so a new connection attempt delivered locally via 'ipfw fwd' would fail to find a match. As of r248886 the tag will be detached and freed when passed to the socket buffer.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index e37de24..ad92cfe 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -768,15 +768,6 @@ tcp_input(struct mbuf *m, int off0)
} else
ti_locked = TI_UNLOCKED;
-findpcb:
-#ifdef INVARIANTS
- if (ti_locked == TI_WLOCKED) {
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
- } else {
- INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
- }
-#endif
-
/*
* Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
*/
@@ -793,6 +784,14 @@ findpcb:
)
fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
+findpcb:
+#ifdef INVARIANTS
+ if (ti_locked == TI_WLOCKED) {
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
+ } else {
+ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
+ }
+#endif
#ifdef INET6
if (isipv6 && fwd_tag != NULL) {
struct sockaddr_in6 *next_hop6;
@@ -817,10 +816,6 @@ findpcb:
th->th_dport, INPLOOKUP_WILDCARD |
INPLOOKUP_WLOCKPCB, m->m_pkthdr.rcvif);
}
- /* Remove the tag from the packet. We don't need it anymore. */
- m_tag_delete(m, fwd_tag);
- m->m_flags &= ~M_IP6_NEXTHOP;
- fwd_tag = NULL;
} else if (isipv6) {
inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src,
th->th_sport, &ip6->ip6_dst, th->th_dport,
@@ -855,10 +850,6 @@ findpcb:
th->th_dport, INPLOOKUP_WILDCARD |
INPLOOKUP_WLOCKPCB, m->m_pkthdr.rcvif);
}
- /* Remove the tag from the packet. We don't need it anymore. */
- m_tag_delete(m, fwd_tag);
- m->m_flags &= ~M_IP_NEXTHOP;
- fwd_tag = NULL;
} else
inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src,
th->th_sport, ip->ip_dst, th->th_dport,
OpenPOWER on IntegriCloud