diff options
author | 2016-03-29 04:33:16 +0000 | |
---|---|---|
committer | 2016-03-29 04:33:16 +0000 | |
commit | 721e7e34f9f170f3c950203ca09eab51c25b0a24 (patch) | |
tree | 1cd4654e34cbbc4a6e090729fe99d750c04bc965 | |
parent | Properly check for the end of captured packet while printing CDP packets. (diff) | |
download | wireguard-openbsd-721e7e34f9f170f3c950203ca09eab51c25b0a24.tar.xz wireguard-openbsd-721e7e34f9f170f3c950203ca09eab51c25b0a24.zip |
use sizeof(*evl) instead of EVL_ENCAPLEN in vlan_input
-rw-r--r-- | sys/net/if_vlan.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 15b3dee3d30..170bc9f732b 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.156 2016/03/28 13:05:22 dlg Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.157 2016/03/29 04:33:16 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -336,8 +336,8 @@ vlan_input(struct ifnet *ifp0, struct mbuf *m, void *cookie) etype = ETHERTYPE_VLAN; tagh = vlan_tagh; } else if ((etype == ETHERTYPE_VLAN) || (etype == ETHERTYPE_QINQ)) { - if (m->m_len < EVL_ENCAPLEN && - (m = m_pullup(m, EVL_ENCAPLEN)) == NULL) { + if (m->m_len < sizeof(*evl) && + (m = m_pullup(m, sizeof(*evl))) == NULL) { ifp0->if_ierrors++; return (1); } @@ -395,8 +395,8 @@ vlan_input(struct ifnet *ifp0, struct mbuf *m, void *cookie) m->m_flags &= ~M_VLANTAG; } else { eh->ether_type = evl->evl_proto; - memmove((char *)eh + EVL_ENCAPLEN, eh, sizeof(*eh)); - m_adj(m, EVL_ENCAPLEN); + memmove((char *)eh + sizeof(*evl), eh, sizeof(*eh)); + m_adj(m, sizeof(*evl)); } ml_enqueue(&ml, m); |