Date: Wed, 6 Jun 2018 05:17:21 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334703 - head/sys/netinet6 Message-ID: <201806060517.w565HLnT058787@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Wed Jun 6 05:17:21 2018 New Revision: 334703 URL: https://svnweb.freebsd.org/changeset/base/334703 Log: 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. Modified: head/sys/netinet6/ip6_gre.c Modified: head/sys/netinet6/ip6_gre.c ============================================================================== --- head/sys/netinet6/ip6_gre.c Wed Jun 6 05:08:05 2018 (r334702) +++ head/sys/netinet6/ip6_gre.c Wed Jun 6 05:17:21 2018 (r334703) @@ -79,17 +79,6 @@ in6_gre_encapcheck(const struct mbuf *m, int off, int 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806060517.w565HLnT058787>