Commit 6fc7caa8 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

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: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ceb3284c
...@@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1, ...@@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
struct flow_keys *keys1 = &f1->fkeys; struct flow_keys *keys1 = &f1->fkeys;
struct flow_keys *keys2 = &f2->fkeys; struct flow_keys *keys2 = &f2->fkeys;
if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src && if (keys1->basic.n_proto != keys2->basic.n_proto ||
keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst && keys1->basic.ip_proto != keys2->basic.ip_proto)
keys1->ports.ports == keys2->ports.ports && return false;
keys1->basic.ip_proto == keys2->basic.ip_proto &&
keys1->basic.n_proto == keys2->basic.n_proto && 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 && keys1->control.flags == keys2->control.flags &&
ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) && ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr)) ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment