net: aquantia: fix removal of vlan 0

Due to absence of checking against the rx flow rule when vlan 0 is being
removed, the other rule could be removed instead of the rule with vlan 0

Fixes: 7975d2aff5 ("net: aquantia: add support of rx-vlan-filter offload")
Signed-off-by: Dmitry Bogdanov <dmitry.bogdanov@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dmitry Bogdanov 2019-08-30 12:08:30 +00:00 committed by David S. Miller
parent 154f4fb7a0
commit 6fdc060d74
1 changed files with 2 additions and 1 deletions

View File

@ -431,7 +431,8 @@ int aq_del_fvlan_by_vlan(struct aq_nic_s *aq_nic, u16 vlan_id)
if (be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) if (be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id)
break; break;
} }
if (rule && be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) { if (rule && rule->type == aq_rx_filter_vlan &&
be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) {
struct ethtool_rxnfc cmd; struct ethtool_rxnfc cmd;
cmd.fs.location = rule->aq_fsp.location; cmd.fs.location = rule->aq_fsp.location;