Searched hist:"838 c8c47860a0203130bd558d507a0565a2eba8f" (Results 1 – 2 of 2) sorted by relevance
/freebsd/sys/net/ |
H A D | ethernet.h | diff 838c8c47860a0203130bd558d507a0565a2eba8f Wed Aug 23 11:48:12 CEST 2023 Zhenlei Huang <zlei@FreeBSD.org> net: Do not overwrite if_vlan's PCP
In commit c7cffd65c5d8 the function ether_8021q_frame() was slightly refactored to use pointer of struct ether_8021q_tag as parameter qtag to include the new option proto.
It is wrong to write to qtag->pcp as it will effectively change the memory that qtag points to. Unfortunately the transmit routine of if_vlan parses pointer of the member ifv_qtag of its softc which stores vlan interface's PCP internally, when transmitting mbufs that contains PCP the vlan interface's PCP will get overwritten.
Fix by operating on a local copy of qtag->pcp. Also mark 'struct ether_8021q_tag' as const so that compilers can pick up such kind of bug.
PR: 273304 Reviewed by: kp Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39505
|
H A D | if_ethersubr.c | diff 838c8c47860a0203130bd558d507a0565a2eba8f Wed Aug 23 11:48:12 CEST 2023 Zhenlei Huang <zlei@FreeBSD.org> net: Do not overwrite if_vlan's PCP
In commit c7cffd65c5d8 the function ether_8021q_frame() was slightly refactored to use pointer of struct ether_8021q_tag as parameter qtag to include the new option proto.
It is wrong to write to qtag->pcp as it will effectively change the memory that qtag points to. Unfortunately the transmit routine of if_vlan parses pointer of the member ifv_qtag of its softc which stores vlan interface's PCP internally, when transmitting mbufs that contains PCP the vlan interface's PCP will get overwritten.
Fix by operating on a local copy of qtag->pcp. Also mark 'struct ether_8021q_tag' as const so that compilers can pick up such kind of bug.
PR: 273304 Reviewed by: kp Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39505
|