diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-25 09:24:10 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-25 09:24:10 +0000 |
commit | 860ce566d388e383a0ad004238f6ea64ec9752fb (patch) | |
tree | c0758aba06be0ee354d95c51853270df6087b85f | |
parent | 109500a5599857c7c5bacadd3671dbaf42cf09d6 (diff) |
Remove Multicast and Broadcast flags from the encapsulated packet in
vxlan(4) like it is done by other tunnelling pseudo-interfaces.
While here sync the comment between multiple interfaces.
Bug report and original diff from Pierre LALET.
-rw-r--r-- | sys/net/if_etherip.c | 10 | ||||
-rw-r--r-- | sys/net/if_gif.c | 3 | ||||
-rw-r--r-- | sys/net/if_vxlan.c | 16 |
3 files changed, 25 insertions, 4 deletions
diff --git a/sys/net/if_etherip.c b/sys/net/if_etherip.c index 5d83bd1d4e8..fecbd2f9d9c 100644 --- a/sys/net/if_etherip.c +++ b/sys/net/if_etherip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_etherip.c,v 1.20 2017/10/09 08:35:38 mpi Exp $ */ +/* $OpenBSD: if_etherip.c,v 1.21 2017/10/25 09:24:09 mpi Exp $ */ /* * Copyright (c) 2015 Kazuya GODA <goda@openbsd.org> * @@ -363,6 +363,10 @@ ip_etherip_output(struct ifnet *ifp, struct mbuf *m) return ENETUNREACH; } + /* + * Remove multicast and broadcast flags or encapsulated packet + * ends up as multicast or broadcast packet. + */ m->m_flags &= ~(M_BCAST|M_MCAST); M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); @@ -520,6 +524,10 @@ ip6_etherip_output(struct ifnet *ifp, struct mbuf *m) goto drop; } + /* + * Remove multicast and broadcast flags or encapsulated packet + * ends up as multicast or broadcast packet. + */ m->m_flags &= ~(M_BCAST|M_MCAST); M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 3baba5f9729..72c30004d31 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gif.c,v 1.100 2017/10/16 13:40:58 mpi Exp $ */ +/* $OpenBSD: if_gif.c,v 1.101 2017/10/25 09:24:09 mpi Exp $ */ /* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */ /* @@ -256,6 +256,7 @@ gif_encap(struct ifnet *ifp, struct mbuf **mp, sa_family_t af) { struct gif_softc *sc = (struct gif_softc*)ifp; int error = 0; + /* * Remove multicast and broadcast flags or encapsulated packet * ends up as multicast or broadcast packet. diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index c2d296f1681..190b2b880d3 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.62 2017/08/11 21:24:19 mpi Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.63 2017/10/25 09:24:09 mpi Exp $ */ /* * Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org> @@ -665,7 +665,7 @@ vxlan_lookup(struct mbuf *m, struct udphdr *uh, int iphlen, } #endif - m->m_flags &= ~(M_MCAST|M_BCAST); + m->m_flags &= ~(M_BCAST|M_MCAST); #if NPF > 0 pf_pkt_addr_changed(m); @@ -702,6 +702,12 @@ vxlan_encap4(struct ifnet *ifp, struct mbuf *m, struct vxlan_softc *sc = (struct vxlan_softc *)ifp->if_softc; struct ip *ip; + /* + * Remove multicast and broadcast flags or encapsulated packet + * ends up as multicast or broadcast packet. + */ + m->m_flags &= ~(M_BCAST|M_MCAST); + M_PREPEND(m, sizeof(*ip), M_DONTWAIT); if (m == NULL) return (NULL); @@ -735,6 +741,12 @@ vxlan_encap6(struct ifnet *ifp, struct mbuf *m, struct ip6_hdr *ip6; struct in6_addr *in6a; + /* + * Remove multicast and broadcast flags or encapsulated packet + * ends up as multicast or broadcast packet. + */ + m->m_flags &= ~(M_BCAST|M_MCAST); + M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT); if (m == NULL) return (NULL); |