summaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-05-31 13:20:45 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-01 15:02:05 -0700
commit4ef8d857b5f494e62bce9085031563fda35f9563 (patch)
treec0a3a85212909e265f81b57bc4705bc0b572a37b /net/core/sock.c
parent4ac06a1e013cf5fdd963317ffd3b968560f33bba (diff)
downloadlinux-stable-4ef8d857b5f494e62bce9085031563fda35f9563.tar.gz
linux-stable-4ef8d857b5f494e62bce9085031563fda35f9563.tar.bz2
linux-stable-4ef8d857b5f494e62bce9085031563fda35f9563.zip
net: dsa: tag_8021q: fix the VLAN IDs used for encoding sub-VLANs
When using sub-VLANs in the range of 1-7, the resulting value from: rx_vid = dsa_8021q_rx_vid_subvlan(ds, port, subvlan); is wrong according to the description from tag_8021q.c: | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +-----------+-----+-----------------+-----------+-----------------------+ | DIR | SVL | SWITCH_ID | SUBVLAN | PORT | +-----------+-----+-----------------+-----------+-----------------------+ For example, when ds->index == 0, port == 3 and subvlan == 1, dsa_8021q_rx_vid_subvlan() returns 1027, same as it returns for subvlan == 0, but it should have returned 1043. This is because the low portion of the subvlan bits are not masked properly when writing into the 12-bit VLAN value. They are masked into bits 4:3, but they should be masked into bits 5:4. Fixes: 3eaae1d05f2b ("net: dsa: tag_8021q: support up to 8 VLANs per port using sub-VLANs") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
0 files changed, 0 insertions, 0 deletions