提交 091056b2 编写于 作者: A Amit Kumar Salecha 提交者: David S. Miller

qlcnic: validate eswitch config values for PF

Currently driver set default eswitch configuration values for PF function,
instead of validating values sent by application.
Signed-off-by: NAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: NAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 97319a27
...@@ -3537,9 +3537,12 @@ validate_esw_config(struct qlcnic_adapter *adapter, ...@@ -3537,9 +3537,12 @@ validate_esw_config(struct qlcnic_adapter *adapter,
case QLCNIC_PORT_DEFAULTS: case QLCNIC_PORT_DEFAULTS:
if (QLC_DEV_GET_DRV(op_mode, pci_func) != if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
QLCNIC_NON_PRIV_FUNC) { QLCNIC_NON_PRIV_FUNC) {
esw_cfg[i].mac_anti_spoof = 0; if (esw_cfg[i].mac_anti_spoof != 0)
esw_cfg[i].mac_override = 1; return QL_STATUS_INVALID_PARAM;
esw_cfg[i].promisc_mode = 1; if (esw_cfg[i].mac_override != 1)
return QL_STATUS_INVALID_PARAM;
if (esw_cfg[i].promisc_mode != 1)
return QL_STATUS_INVALID_PARAM;
} }
break; break;
case QLCNIC_ADD_VLAN: case QLCNIC_ADD_VLAN:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册