mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 03:06:43 +00:00
bnxt_en: Fix ipv6 RFS filter matching logic.
Fix bnxt_fltr_match() to match ipv6 source and destination addresses. The function currently only checks ipv4 addresses and will not work corrently on ipv6 filters. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ceb3284c58
commit
6fc7caa84e
@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
|
||||
struct flow_keys *keys1 = &f1->fkeys;
|
||||
struct flow_keys *keys2 = &f2->fkeys;
|
||||
|
||||
if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&
|
||||
keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&
|
||||
keys1->ports.ports == keys2->ports.ports &&
|
||||
keys1->basic.ip_proto == keys2->basic.ip_proto &&
|
||||
keys1->basic.n_proto == keys2->basic.n_proto &&
|
||||
if (keys1->basic.n_proto != keys2->basic.n_proto ||
|
||||
keys1->basic.ip_proto != keys2->basic.ip_proto)
|
||||
return false;
|
||||
|
||||
if (keys1->basic.n_proto == htons(ETH_P_IP)) {
|
||||
if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src ||
|
||||
keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst)
|
||||
return false;
|
||||
} else {
|
||||
if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src,
|
||||
sizeof(keys1->addrs.v6addrs.src)) ||
|
||||
memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst,
|
||||
sizeof(keys1->addrs.v6addrs.dst)))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (keys1->ports.ports == keys2->ports.ports &&
|
||||
keys1->control.flags == keys2->control.flags &&
|
||||
ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
|
||||
ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
|
||||
|
Loading…
x
Reference in New Issue
Block a user