diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-15 09:58:45 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-15 09:58:45 +0000 |
commit | 6255e9e305ee8af381e7a231e1f482b43e764cfc (patch) | |
tree | 262987848aa946144f98b793d81bac75c4285906 /sys/net/if_vlan.c | |
parent | d61456795d49ac560324bfe85066e332f9f1b88e (diff) |
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@
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r-- | sys/net/if_vlan.c | 11 |
1 files changed, 9 insertions, 2 deletions
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); } |