Fix LINT-NOINET build.

Use known at build time size for min_length value. Also remove the
check from in6_gre_encapcheck(), now it is done in generic code.
This commit is contained in:
Andrey V. Elsukov 2018-06-06 05:17:21 +00:00
parent ffc3ab5d39
commit a41372abd4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334703

View File

@ -79,17 +79,6 @@ in6_gre_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
return (0);
M_ASSERTPKTHDR(m);
/*
* We expect that payload contains at least IPv4
* or IPv6 packet.
*/
if (m->m_pkthdr.len < sizeof(struct greip6) +
#ifdef INET
sizeof(struct ip))
#else
sizeof(struct ip6_hdr))
#endif
return (0);
GRE_RLOCK(sc);
if (sc->gre_family == 0)
@ -122,7 +111,12 @@ in6_gre_output(struct mbuf *m, int af, int hlen)
static const struct encap_config ipv6_encap_cfg = {
.proto = IPPROTO_GRE,
.min_length = sizeof(struct greip6) + sizeof(struct ip),
.min_length = sizeof(struct greip6) +
#ifdef INET
sizeof(struct ip),
#else
sizeof(struct ip6_hdr),
#endif
.exact_match = (sizeof(struct in6_addr) << 4) + 32,
.check = in6_gre_encapcheck,
.input = gre_input