Index: sys/netinet/in_gif.c =================================================================== RCS file: /cvsroot/src/sys/netinet/in_gif.c,v retrieving revision 1.75 diff -p -u -r1.75 in_gif.c --- sys/netinet/in_gif.c 26 Jan 2016 06:00:10 -0000 1.75 +++ sys/netinet/in_gif.c 3 Feb 2016 22:13:47 -0000 @@ -200,6 +200,11 @@ in_gif_input(struct mbuf *m, int off, in int af; u_int8_t otos; + KASSERT(IP_HDR_ALIGNED_P(mtod(m, void *))); + KASSERT(IP_HDR_ALIGNED_P(off)); + KASSERT(IP6_HDR_ALIGNED_P(off)); + KASSERT(TCP_HDR_ALIGNED_P(off)); + KASSERT(UDP_HDR_ALIGNED_P(off)); ip = mtod(m, const struct ip *); gifp = (struct ifnet *)encap_getarg(m); @@ -226,6 +231,7 @@ in_gif_input(struct mbuf *m, int off, in #endif otos = ip->ip_tos; m_adj(m, off); + KASSERT(IP_HDR_ALIGNED_P(mtod(m, void *))); switch (proto) { #ifdef INET @@ -237,6 +243,7 @@ in_gif_input(struct mbuf *m, int off, in if ((m = m_pullup(m, sizeof(*xip))) == NULL) return; } + KASSERT(IP_HDR_ALIGNED_P(mtod(m, void *))); xip = mtod(m, struct ip *); if (gifp->if_flags & IFF_LINK1) ip_ecn_egress(ECN_ALLOWED, &otos, &xip->ip_tos); @@ -255,6 +262,7 @@ in_gif_input(struct mbuf *m, int off, in if ((m = m_pullup(m, sizeof(*ip6))) == NULL) return; } + KASSERT(IP6_HDR_ALIGNED_P(mtod(m, void *))); ip6 = mtod(m, struct ip6_hdr *); itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; if (gifp->if_flags & IFF_LINK1)