From: mpi Date: Wed, 15 Apr 2015 09:58:44 +0000 (+0000) Subject: Add the necessary glue to keep vlan(4) working while other pseudo-drivers X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3a5f6911dc08010e0e9923bba942340018241b6f;p=openbsd Add the necessary glue to keep vlan(4) working while other pseudo-drivers are converted to if_input(). Reviewed by Rafael Zalamena. ok claudio@, dlg@ --- diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 83482bbbdd1..f79176129a5 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.116 2015/04/13 08:52:51 mpi Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.117 2015/04/15 09:58:44 mpi Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -277,6 +277,7 @@ vlan_input(struct ether_header *eh, struct mbuf *m) struct vlan_taghash *tagh; u_int tag; u_int16_t etype; + struct ether_header *eh1; if (m->m_flags & M_VLANTAG) { etype = ETHERTYPE_VLAN; @@ -363,8 +364,14 @@ vlan_input(struct ether_header *eh, struct mbuf *m) } } + M_PREPEND(m, sizeof(*eh1), M_DONTWAIT); + if (m == NULL) + return (-1); + eh1 = mtod(m, struct ether_header *); + memmove(eh1, eh, sizeof(*eh1)); + ifv->ifv_if.if_ipackets++; - ether_input(m, eh); + ether_input_mbuf(&ifv->ifv_if, m); return (0); }