summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_lookup.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-01-25 17:28:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2021-01-27 22:53:29 +0100
commit4f16d25c68ec844299a4df6ecbb0234eaf88a935 (patch)
tree6a33c0d31109e978f496586343b7a35c8f8f4a32 /net/netfilter/nft_lookup.c
parentdbc859d96f1a90bafe9c3ba2e437aae5d5677318 (diff)
downloadlinux-stable-4f16d25c68ec844299a4df6ecbb0234eaf88a935.tar.gz
linux-stable-4f16d25c68ec844299a4df6ecbb0234eaf88a935.tar.bz2
linux-stable-4f16d25c68ec844299a4df6ecbb0234eaf88a935.zip
netfilter: nftables: add nft_parse_register_load() and use it
This new function combines the netlink register attribute parser and the load validation function. This update requires to replace: enum nft_registers sreg:8; in many of the expression private areas otherwise compiler complains with: error: cannot take address of bit-field ‘sreg’ when passing the register field as reference. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_lookup.c')
-rw-r--r--net/netfilter/nft_lookup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c
index f1363b8aabba..9e87b6d39f51 100644
--- a/net/netfilter/nft_lookup.c
+++ b/net/netfilter/nft_lookup.c
@@ -17,7 +17,7 @@
struct nft_lookup {
struct nft_set *set;
- enum nft_registers sreg:8;
+ u8 sreg;
enum nft_registers dreg:8;
bool invert;
struct nft_set_binding binding;
@@ -76,8 +76,8 @@ static int nft_lookup_init(const struct nft_ctx *ctx,
if (IS_ERR(set))
return PTR_ERR(set);
- priv->sreg = nft_parse_register(tb[NFTA_LOOKUP_SREG]);
- err = nft_validate_register_load(priv->sreg, set->klen);
+ err = nft_parse_register_load(tb[NFTA_LOOKUP_SREG], &priv->sreg,
+ set->klen);
if (err < 0)
return err;