提交 a73eb651 编写于 作者: A Andre Guedes 提交者: Jeff Kirsher

igc: Improve address check in igc_del_mac_filter()

igc_add_mac_filter() doesn't allow filters with invalid MAC address to
be added to adapter->mac_table so, in igc_del_mac_filter(), we can early
return if MAC address is invalid. No need to traverse the table.
Signed-off-by: NAndre Guedes <andre.guedes@intel.com>
Tested-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 424045be
...@@ -2246,7 +2246,7 @@ static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr, ...@@ -2246,7 +2246,7 @@ static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
int rar_entries = hw->mac.rar_entry_count; int rar_entries = hw->mac.rar_entry_count;
int i; int i;
if (is_zero_ether_addr(addr)) if (!is_valid_ether_addr(addr))
return -EINVAL; return -EINVAL;
/* Search for matching entry in the MAC table based on given address /* Search for matching entry in the MAC table based on given address
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册