From owner-svn-src-head@freebsd.org Fri Nov 15 21:55:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9E781B1BFD; Fri, 15 Nov 2019 21:55:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47FBxB44hfz3F2p; Fri, 15 Nov 2019 21:55:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E641F5D7; Fri, 15 Nov 2019 21:55:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAFLtfic007149; Fri, 15 Nov 2019 21:55:41 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAFLtfoQ007148; Fri, 15 Nov 2019 21:55:41 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911152155.xAFLtfoQ007148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 15 Nov 2019 21:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354751 - in head: share/doc/IPv6 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: share/doc/IPv6 sys/netinet X-SVN-Commit-Revision: 354751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Nov 2019 21:55:44 -0000 Author: bz Date: Fri Nov 15 21:55:41 2019 New Revision: 354751 URL: https://svnweb.freebsd.org/changeset/base/354751 Log: Remove now unused IPv6 macros and update docs. After r354748-354750 all uses of the IP6_EXTHDR_CHECK() and IP6_EXTHDR_GET() macros are gone from the kernel. IP6_EXTHDR_GET0() was unused. Remove the macros and update the documentation. Sponsored by: Netflix Modified: head/share/doc/IPv6/IMPLEMENTATION head/sys/netinet/ip6.h Modified: head/share/doc/IPv6/IMPLEMENTATION ============================================================================== --- head/share/doc/IPv6/IMPLEMENTATION Fri Nov 15 21:51:43 2019 (r354750) +++ head/share/doc/IPv6/IMPLEMENTATION Fri Nov 15 21:55:41 2019 (r354751) @@ -1049,20 +1049,6 @@ requirement. (For more information, refer to Section 2 3282 one ext mbuf 0 two or more ext mbuf -Each input function calls IP6_EXTHDR_CHECK in the beginning to check -if the region between IP6 and its header is -continuous. IP6_EXTHDR_CHECK calls m_pullup() only if the mbuf has -M_LOOP flag, that is, the packet comes from the loopback -interface. m_pullup() is never called for packets coming from physical -network interfaces. - -TCP6 reassembly makes use of IP6 header to store reassemble -information. IP6 is not supposed to be just before TCP6, so -ip6tcpreass structure has a pointer to TCP6 header. Of course, it has -also a pointer back to mbuf to avoid m_pullup(). - -Like TCP6, both IP and IP6 reassemble functions never call m_pullup(). - xxx_ctlinput() calls in_mrejoin() on PRC_IFNEWADDR. We think this is one of 4.4BSD implementation flaws. Since 4.4BSD keeps ia_multiaddrs in in_ifaddr{}, it can't use multicast feature if the interface has no Modified: head/sys/netinet/ip6.h ============================================================================== --- head/sys/netinet/ip6.h Fri Nov 15 21:51:43 2019 (r354750) +++ head/sys/netinet/ip6.h Fri Nov 15 21:55:41 2019 (r354751) @@ -262,88 +262,4 @@ struct ip6_frag { #define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/ #define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */ -#ifdef _KERNEL -/* - * IP6_EXTHDR_CHECK ensures that region between the IP6 header and the - * target header (including IPv6 itself, extension headers and - * TCP/UDP/ICMP6 headers) are contiguous. KAME requires drivers - * to store incoming data into one internal mbuf or one or more external - * mbufs(never into two or more internal mbufs). Thus, the third case is - * supposed to never be matched but is prepared just in case. - */ - -#define IP6_EXTHDR_CHECK(m, off, hlen, ret) \ -do { \ - if ((m)->m_next != NULL) { \ - if (((m)->m_flags & M_LOOP) && \ - ((m)->m_len < (off) + (hlen)) && \ - (((m) = m_pullup((m), (off) + (hlen))) == NULL)) { \ - IP6STAT_INC(ip6s_exthdrtoolong); \ - return ret; \ - } else { \ - if ((m)->m_len < (off) + (hlen)) { \ - IP6STAT_INC(ip6s_exthdrtoolong); \ - m_freem(m); \ - return ret; \ - } \ - } \ - } else { \ - if ((m)->m_len < (off) + (hlen)) { \ - IP6STAT_INC(ip6s_tooshort); \ - in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_truncated); \ - m_freem(m); \ - return ret; \ - } \ - } \ -} while (/*CONSTCOND*/ 0) - -/* - * IP6_EXTHDR_GET ensures that intermediate protocol header (from "off" to - * "len") is located in single mbuf, on contiguous memory region. - * The pointer to the region will be returned to pointer variable "val", - * with type "typ". - * IP6_EXTHDR_GET0 does the same, except that it aligns the structure at the - * very top of mbuf. GET0 is likely to make memory copy than GET. - * - * XXX we're now testing this, needs m_pulldown() - */ -#define IP6_EXTHDR_GET(val, typ, m, off, len) \ -do { \ - struct mbuf *t; \ - int tmp; \ - if ((m)->m_len >= (off) + (len)) \ - (val) = (typ)(mtod((m), caddr_t) + (off)); \ - else { \ - t = m_pulldown((m), (off), (len), &tmp); \ - if (t) { \ - if (t->m_len < tmp + (len)) \ - panic("m_pulldown malfunction"); \ - (val) = (typ)(mtod(t, caddr_t) + tmp); \ - } else { \ - (val) = (typ)NULL; \ - (m) = NULL; \ - } \ - } \ -} while (/*CONSTCOND*/ 0) - -#define IP6_EXTHDR_GET0(val, typ, m, off, len) \ -do { \ - struct mbuf *t; \ - if ((off) == 0) \ - (val) = (typ)mtod(m, caddr_t); \ - else { \ - t = m_pulldown((m), (off), (len), NULL); \ - if (t) { \ - if (t->m_len < (len)) \ - panic("m_pulldown malfunction"); \ - (val) = (typ)mtod(t, caddr_t); \ - } else { \ - (val) = (typ)NULL; \ - (m) = NULL; \ - } \ - } \ -} while (/*CONSTCOND*/ 0) - -#endif /*_KERNEL*/ - #endif /* not _NETINET_IP6_H_ */