[PATCH 5.5 136/170] netfilter: flowtable: populate addr_type mask
From: Greg Kroah-Hartman
Date: Tue Mar 31 2020 - 05:08:26 EST
From: Edward Cree <ecree@xxxxxxxxxxxxxx>
commit 15ff197237e76c4dab06b7b518afaa4ebb1c43e0 upstream.
nf_flow_rule_match() sets control.addr_type in key, so needs to also set
the corresponding mask. An exact match is wanted, so mask is all ones.
Fixes: c29f74e0df7a ("netfilter: nf_flow_table: hardware offload support")
Signed-off-by: Edward Cree <ecree@xxxxxxxxxxxxxx>
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
net/netfilter/nf_flow_table_offload.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/netfilter/nf_flow_table_offload.c
+++ b/net/netfilter/nf_flow_table_offload.c
@@ -87,6 +87,7 @@ static int nf_flow_rule_match(struct nf_
default:
return -EOPNOTSUPP;
}
+ mask->control.addr_type = 0xffff;
match->dissector.used_keys |= BIT(key->control.addr_type);
mask->basic.n_proto = 0xffff;