summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vxlan.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-10-25 09:24:09 +0000
committermpi <mpi@openbsd.org>2017-10-25 09:24:09 +0000
commit17d55011419f793414a5f455202e4d90d67f957a (patch)
tree29ae21bbf8e9a3139b604d305d619b747cf571b4 /sys/net/if_vxlan.c
parenttweak the uri text, specifically removing some markup to make it a (diff)
downloadwireguard-openbsd-17d55011419f793414a5f455202e4d90d67f957a.tar.xz
wireguard-openbsd-17d55011419f793414a5f455202e4d90d67f957a.zip
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.
Diffstat (limited to 'sys/net/if_vxlan.c')
-rw-r--r--sys/net/if_vxlan.c16
1 files changed, 14 insertions, 2 deletions
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);