svn commit: r354750 - head/sys/netinet
Bjoern A. Zeeb
bz at FreeBSD.org
Fri Nov 15 21:51:44 UTC 2019
Author: bz
Date: Fri Nov 15 21:51:43 2019
New Revision: 354750
URL: https://svnweb.freebsd.org/changeset/base/354750
Log:
IP6_EXTHDR_CHECK(): remove the last instances
While r354748 removed almost all IP6_EXTHDR_CHECK() calls, these
are not part of the PULLDOWN_TESTS.
Equally convert these IP6_EXTHDR_CHECK()s here to m_pullup() and remove
the extra check and m_pullup() in tcp_input() under isipv6 given
tcp6_input() has done exactly that pullup already.
MFC after: 8 weeks
Sponsored by: Netflix
Modified:
head/sys/netinet/tcp_input.c
Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c Fri Nov 15 21:44:17 2019 (r354749)
+++ head/sys/netinet/tcp_input.c Fri Nov 15 21:51:43 2019 (r354750)
@@ -517,7 +517,12 @@ tcp6_input(struct mbuf **mp, int *offp, int proto)
struct ip6_hdr *ip6;
m = *mp;
- IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE);
+ m = m_pullup(m, *offp + sizeof(struct tcphdr));
+ if (m == NULL) {
+ *mp = m;
+ TCPSTAT_INC(tcps_rcvshort);
+ return (IPPROTO_DONE);
+ }
/*
* draft-itojun-ipv6-tcp-to-anycast
@@ -595,16 +600,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
#ifdef INET6
if (isipv6) {
- /* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */
- if (m->m_len < (sizeof(*ip6) + sizeof(*th))) {
- m = m_pullup(m, sizeof(*ip6) + sizeof(*th));
- if (m == NULL) {
- TCPSTAT_INC(tcps_rcvshort);
- return (IPPROTO_DONE);
- }
- }
-
ip6 = mtod(m, struct ip6_hdr *);
th = (struct tcphdr *)((caddr_t)ip6 + off0);
tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0;
@@ -712,7 +708,11 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
if (off > sizeof (struct tcphdr)) {
#ifdef INET6
if (isipv6) {
- IP6_EXTHDR_CHECK(m, off0, off, IPPROTO_DONE);
+ m = m_pullup(m, off0 + off);
+ if (m == NULL) {
+ TCPSTAT_INC(tcps_rcvshort);
+ return (IPPROTO_DONE);
+ }
ip6 = mtod(m, struct ip6_hdr *);
th = (struct tcphdr *)((caddr_t)ip6 + off0);
}
More information about the svn-src-head
mailing list