Skip to content

Commit 30d8938

Browse files
haukedavem330
authored andcommitted
net: dsa: lantiq: Allow special tags only on CPU port
Allow the special tag in ingress only on the CPU port and not on all ports. A packet with a special tag could circumvent the hardware forwarding and should only be allowed on the CPU port where Linux controls the port. Fixes: 14fceff ("net: dsa: Add Lantiq / Intel DSA driver for vrx200)" Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 14cfbda commit 30d8938

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/dsa/lantiq_gswip.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,6 @@ static int gswip_port_enable(struct dsa_switch *ds, int port,
461461
GSWIP_FDMA_PCTRLp(port));
462462
gswip_switch_mask(priv, 0, GSWIP_SDMA_PCTRL_EN,
463463
GSWIP_SDMA_PCTRLp(port));
464-
gswip_switch_mask(priv, 0, GSWIP_PCE_PCTRL_0_INGRESS,
465-
GSWIP_PCE_PCTRL_0p(port));
466464

467465
if (!dsa_is_cpu_port(ds, port)) {
468466
u32 macconf = GSWIP_MDIO_PHY_LINK_AUTO |
@@ -578,6 +576,10 @@ static int gswip_setup(struct dsa_switch *ds)
578576
gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN,
579577
GSWIP_FDMA_PCTRLp(cpu_port));
580578

579+
/* accept special tag in ingress direction */
580+
gswip_switch_mask(priv, 0, GSWIP_PCE_PCTRL_0_INGRESS,
581+
GSWIP_PCE_PCTRL_0p(cpu_port));
582+
581583
gswip_switch_mask(priv, 0, GSWIP_MAC_CTRL_2_MLEN,
582584
GSWIP_MAC_CTRL_2p(cpu_port));
583585
gswip_switch_w(priv, VLAN_ETH_FRAME_LEN + 8, GSWIP_MAC_FLEN);

0 commit comments

Comments
 (0)