Bug 165296

Summary: [vlan] [patch] Fix EVL_APPLY_VLID, update EVL_APPLY_PRI macro
Product: Base System Reporter: Ivan Rozhuk <rozhuk.im>
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: Closed Feedback Timeout    
Severity: Affects Only Me CC: rozhuk.im
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
if_vlan_var.h.patch none

Description Ivan Rozhuk 2012-02-19 17:50:01 UTC
EVL_APPLY_VLID macro removes the flag Canonical Format Indicator (CFI) and the Priority Code Point (PCP) instead of removing VLAN Identifier (VID). The new VID is superimposed on the old one.
(m) -> m_pkthdr.ether_vtag & = EVL_VLID_MASK; \
(m) -> m_pkthdr.ether_vtag | = (vlid); \

The correct version:
(m) -> m_pkthdr.ether_vtag & = ~ EVL_VLID_MASK; \
(m) -> m_pkthdr.ether_vtag | = ((vlid) & EVL_VLID_MASK); \

Fix: apply patch

Patch attached with submission follows:
Comment 1 Ivan Rozhuk 2012-02-19 18:16:00 UTC
-             (m)->m_pkthdr.ether_vtag |= (((pri) & 7) << 1);            \
+             (m)->m_pkthdr.ether_vtag |= (((pri) & 7) << 13);           \
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2012-02-20 01:54:04 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).