diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2019-11-15 21:55:41 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2019-11-15 21:55:41 +0000 |
| commit | b141dd5ddfe9d0b5da8ee88541860c8629a4aeed (patch) | |
| tree | dca905409ce94326b00f5ba61b330c2f676a006b /sys/netinet/ip6.h | |
| parent | 4e619b17c5bb4e1cc1a707441218a85b16f9f4a2 (diff) | |
Notes
Diffstat (limited to 'sys/netinet/ip6.h')
| -rw-r--r-- | sys/netinet/ip6.h | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index 1f4be3fd1b3db..ee4f6a1d4da42 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -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_ */ |
