diff options
-rw-r--r-- | sys/net/if_gre.c | 17 | ||||
-rw-r--r-- | sys/net/if_vxlan.c | 8 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 6 |
3 files changed, 17 insertions, 14 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 49a1bda48d9..5dc3c1db89f 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.140 2018/11/29 00:14:29 dlg Exp $ */ +/* $OpenBSD: if_gre.c,v 1.141 2018/12/03 17:25:22 claudio Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -1939,7 +1939,8 @@ egre_start(struct ifnet *ifp) bpf_mtap_ether(if_bpf, m0, BPF_DIRECTION_OUT); #endif - m = m_gethdr(M_DONTWAIT, m0->m_type); + /* force prepend mbuf because of alignment problems */ + m = m_get(M_DONTWAIT, m0->m_type); if (m == NULL) { m_freem(m0); continue; @@ -1948,7 +1949,7 @@ egre_start(struct ifnet *ifp) M_MOVE_PKTHDR(m, m0); m->m_next = m0; - MH_ALIGN(m, 0); + m_align(m, 0); m->m_len = 0; m = gre_encap(&sc->sc_tunnel, m, htons(ETHERTYPE_TRANSETHER), @@ -3757,7 +3758,8 @@ nvgre_start(struct ifnet *ifp) rw_exit_read(&sc->sc_ether_lock); } - m = m_gethdr(M_DONTWAIT, m0->m_type); + /* force prepend mbuf because of alignment problems */ + m = m_get(M_DONTWAIT, m0->m_type); if (m == NULL) { m_freem(m0); continue; @@ -3766,7 +3768,7 @@ nvgre_start(struct ifnet *ifp) M_MOVE_PKTHDR(m, m0); m->m_next = m0; - MH_ALIGN(m, 0); + m_align(m, 0); m->m_len = 0; m = gre_encap_dst(tunnel, &gateway, m, @@ -3932,7 +3934,8 @@ eoip_start(struct ifnet *ifp) bpf_mtap_ether(if_bpf, m0, BPF_DIRECTION_OUT); #endif - m = m_gethdr(M_DONTWAIT, m0->m_type); + /* force prepend mbuf because of alignment problems */ + m = m_get(M_DONTWAIT, m0->m_type); if (m == NULL) { m_freem(m0); continue; @@ -3941,7 +3944,7 @@ eoip_start(struct ifnet *ifp) M_MOVE_PKTHDR(m, m0); m->m_next = m0; - MH_ALIGN(m, 0); + m_align(m, 0); m->m_len = 0; m = eoip_encap(sc, m, gre_l2_tos(&sc->sc_tunnel, m)); diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 307b3902d59..0cfc0878bc8 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.69 2018/11/15 22:22:03 dlg Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.70 2018/12/03 17:25:22 claudio Exp $ */ /* * Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org> @@ -867,8 +867,8 @@ vxlan_output(struct ifnet *ifp, struct mbuf *m) uint32_t tag; struct mbuf *m0; - /* VXLAN header */ - MGETHDR(m0, M_DONTWAIT, m->m_type); + /* VXLAN header, needs new mbuf because of alignment issues */ + MGET(m0, M_DONTWAIT, m->m_type); if (m0 == NULL) { ifp->if_oerrors++; return (ENOBUFS); @@ -876,7 +876,7 @@ vxlan_output(struct ifnet *ifp, struct mbuf *m) M_MOVE_PKTHDR(m0, m); m0->m_next = m; m = m0; - MH_ALIGN(m, sizeof(*vu)); + m_align(m, sizeof(*vu)); m->m_len = sizeof(*vu); m->m_pkthdr.len += sizeof(*vu); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 35f6b42311e..fa8927d5f73 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.240 2018/11/09 14:14:32 claudio Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.241 2018/12/03 17:25:22 claudio Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -2571,13 +2571,13 @@ ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs) ip6 = mtod(m, struct ip6_hdr *); if (m->m_len > sizeof(*ip6)) { - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGET(mh, M_DONTWAIT, MT_HEADER); if (mh == NULL) { m_freem(m); return ENOBUFS; } M_MOVE_PKTHDR(mh, m); - MH_ALIGN(mh, sizeof(*ip6)); + m_align(mh, sizeof(*ip6)); m->m_len -= sizeof(*ip6); m->m_data += sizeof(*ip6); mh->m_next = m; |