summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Jing D(Mark) <jing.d.chen@intel.com>2017-01-17 16:45:26 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2017-01-17 19:46:25 +0100
commitec852c94af39bf384fde9a9addcaa8294466ddcb (patch)
tree2718c0af1f827fcb318b57503165c6dbf6839a1d
parentf1b2e0ef61188ee08e7dac15af145dd836d2476c (diff)
downloaddpdk-ec852c94af39bf384fde9a9addcaa8294466ddcb.zip
dpdk-ec852c94af39bf384fde9a9addcaa8294466ddcb.tar.gz
dpdk-ec852c94af39bf384fde9a9addcaa8294466ddcb.tar.xz
net/i40e: enhance sanity check of MAC
When VF sends request to add a new MAC address, PF host will check if it's a non-zero or unicast address, or it will return with error. In fact, VF still can set multicast address. This change remove to check if it's a unicast address. Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com> Acked-by: Helin Zhang <helin.zhang@intel.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
-rw-r--r--drivers/net/i40e/i40e_pf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 8a6733c..263e843 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -753,8 +753,8 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,
mac = (struct ether_addr *)(addr_list->list[i].addr);
(void)rte_memcpy(&filter.mac_addr, mac, ETHER_ADDR_LEN);
filter.filter_type = RTE_MACVLAN_PERFECT_MATCH;
- if(!is_valid_assigned_ether_addr(mac) ||
- i40e_vsi_add_mac(vf->vsi, &filter)) {
+ if (is_zero_ether_addr(mac) ||
+ i40e_vsi_add_mac(vf->vsi, &filter)) {
ret = I40E_ERR_INVALID_MAC_ADDR;
goto send_msg;
}