Bug 165296 - [vlan] [patch] Fix EVL_APPLY_VLID, update EVL_APPLY_PRI macro
Summary: [vlan] [patch] Fix EVL_APPLY_VLID, update EVL_APPLY_PRI macro
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-19 17:50 UTC by Ivan Rozhuk
Modified: 2017-10-08 18:03 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.26 KB, patch)
2012-02-19 17:50 UTC, Ivan Rozhuk
no flags Details | Diff
if_vlan_var.h.patch (1.30 KB, patch)
2012-02-19 18:16 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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).