summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-05-30 12:56:17 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-05-30 12:56:17 +0000
commit266fac72e1f616dd32bc3abff13fa36a63b26951 (patch)
tree78e8bd0e48da839bc1221757a13f707aa8a5804c /sys/netinet
parent8cd143bfc5594e4f796a079de6d1c47b6281925e (diff)
Insert a hack to deal with interfaces removing the VLAN header before
the packet has been feed to the pseudo-interfaces input handlers. To fix that without introducing a layer violation we should be able to disable HW-vlan on parent when in use with different pseudo-interfaces. In the case of bridge(4) for example it makes no sense to let the interface remove the VLAN header if the kernel has to add it back for every packet. Fix issues reported by sebastia@ and markus@ From dlg@, ok claudio@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_carp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 954c227d210..d9fff8835ca 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.289 2016/05/18 03:46:03 dlg Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.290 2016/05/30 12:56:16 mpi Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -80,6 +80,10 @@
#include <net/bpf.h>
#endif
+#if NVLAN > 0
+#include <net/if_vlan_var.h>
+#endif
+
#include <netinet/ip_carp.h>
struct carp_mc_entry {
@@ -1399,6 +1403,15 @@ carp_input(struct ifnet *ifp0, struct mbuf *m, void *cookie)
struct carp_softc *sc;
struct srp_ref sr;
+#if NVLAN > 0
+ /*
+ * If the underlying interface removed the VLAN header itself,
+ * it's not for us.
+ */
+ if (ISSET(m->m_flags, M_VLANTAG))
+ return (0);
+#endif
+
eh = mtod(m, struct ether_header *);
cif = (struct carp_if *)cookie;
KASSERT(cif == (struct carp_if *)ifp0->if_carp);