diff options
author | 2021-01-25 18:27:22 +0100 | |
---|---|---|
committer | 2021-01-27 23:16:02 +0100 | |
commit | 345023b0db315648ccc3c1a36aee88304a8b4d91 (patch) | |
tree | d9fc56b50d04dacea25e27093052ec3c3cbdaa30 /net/bridge/netfilter/nft_meta_bridge.c | |
parent | netfilter: nftables: add nft_parse_register_load() and use it (diff) | |
download | linux-345023b0db315648ccc3c1a36aee88304a8b4d91.tar.gz linux-345023b0db315648ccc3c1a36aee88304a8b4d91.tar.bz2 linux-345023b0db315648ccc3c1a36aee88304a8b4d91.zip |
netfilter: nftables: add nft_parse_register_store() and use it
This new function combines the netlink register attribute parser
and the store validation function.
This update requires to replace:
enum nft_registers dreg:8;
in many of the expression private areas otherwise compiler complains
with:
error: cannot take address of bit-field ‘dreg’
when passing the register field as reference.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/bridge/netfilter/nft_meta_bridge.c')
-rw-r--r-- | net/bridge/netfilter/nft_meta_bridge.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/bridge/netfilter/nft_meta_bridge.c b/net/bridge/netfilter/nft_meta_bridge.c index 8e8ffac037cd..97805ec424c1 100644 --- a/net/bridge/netfilter/nft_meta_bridge.c +++ b/net/bridge/netfilter/nft_meta_bridge.c @@ -87,9 +87,8 @@ static int nft_meta_bridge_get_init(const struct nft_ctx *ctx, return nft_meta_get_init(ctx, expr, tb); } - priv->dreg = nft_parse_register(tb[NFTA_META_DREG]); - return nft_validate_register_store(ctx, priv->dreg, NULL, - NFT_DATA_VALUE, len); + return nft_parse_register_store(ctx, tb[NFTA_META_DREG], &priv->dreg, + NULL, NFT_DATA_VALUE, len); } static struct nft_expr_type nft_meta_bridge_type; |