Page MenuHomeFreeBSD

D55415.diff
No OneTemporary

D55415.diff

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -582,13 +582,14 @@
if ((m->m_flags & M_PKTHDR) == 0) {
/* Can't handle one that is not a pkt hdr */
TCPSTAT_INC(tcps_tunneled_errs);
- goto out;
+ m_freem(m);
+ return (true);
}
thlen = sizeof(struct tcphdr);
if (m->m_len < off + sizeof(struct udphdr) + thlen &&
(m = m_pullup(m, off + sizeof(struct udphdr) + thlen)) == NULL) {
TCPSTAT_INC(tcps_tunneled_errs);
- goto out;
+ return (true);
}
iph = mtod(m, struct ip *);
uh = (struct udphdr *)((caddr_t)iph + off);
@@ -598,7 +599,7 @@
m = m_pullup(m, off + sizeof(struct udphdr) + thlen);
if (m == NULL) {
TCPSTAT_INC(tcps_tunneled_errs);
- goto out;
+ return (true);
} else {
iph = mtod(m, struct ip *);
uh = (struct udphdr *)((caddr_t)iph + off);
@@ -620,9 +621,10 @@
#ifdef INET
case IPVERSION:
len = ntohs(iph->ip_len) - sizeof(struct udphdr);
- if (len != m->m_pkthdr.len) {
+ if (__predict_false(len != m->m_pkthdr.len)) {
TCPSTAT_INC(tcps_tunneled_errs);
- goto out;
+ m_freem(m);
+ return (true);
} else {
iph->ip_len = htons(len);
tcp_input_with_port(&m, &off, IPPROTO_TCP, port);
@@ -633,9 +635,11 @@
case IPV6_VERSION >> 4:
ip6 = mtod(m, struct ip6_hdr *);
len = ntohs(ip6->ip6_plen) - sizeof(struct udphdr);
- if (len + sizeof(struct ip6_hdr) != m->m_pkthdr.len) {
+ if (__predict_false(len + sizeof(struct ip6_hdr) !=
+ m->m_pkthdr.len)) {
TCPSTAT_INC(tcps_tunneled_errs);
- goto out;
+ m_freem(m);
+ return (true);
} else {
ip6->ip6_plen = htons(len);
tcp6_input_with_port(&m, &off, IPPROTO_TCP, port);
@@ -643,13 +647,9 @@
break;
#endif
default:
- goto out;
+ m_freem(m);
break;
}
- return (true);
-out:
- m_freem(m);
-
return (true);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 16, 7:09 AM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35128607
Default Alt Text
D55415.diff (1 KB)

Event Timeline