Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 091056b2 authored by Amit Kumar Salecha's avatar Amit Kumar Salecha Committed by David S. Miller
Browse files

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: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 97319a27
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -3537,9 +3537,12 @@ validate_esw_config(struct qlcnic_adapter *adapter,
		case QLCNIC_PORT_DEFAULTS:
			if (QLC_DEV_GET_DRV(op_mode, pci_func) !=
						QLCNIC_NON_PRIV_FUNC) {
				esw_cfg[i].mac_anti_spoof = 0;
				esw_cfg[i].mac_override = 1;
				esw_cfg[i].promisc_mode = 1;
				if (esw_cfg[i].mac_anti_spoof != 0)
					return QL_STATUS_INVALID_PARAM;
				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;
		case QLCNIC_ADD_VLAN: