aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_exthdr.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-04-11 02:27:29 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-04-13 16:25:50 +0200
commit27e6d2017abdfbdb8b790c34c93d65ee10ce2fc5 (patch)
treef6565eb45fba1427368254fe4d29e708082cf5ce /net/netfilter/nft_exthdr.c
parentnetfilter: nft_lookup: use nft_validate_register_store() to validate types (diff)
downloadlinux-dev-27e6d2017abdfbdb8b790c34c93d65ee10ce2fc5.tar.xz
linux-dev-27e6d2017abdfbdb8b790c34c93d65ee10ce2fc5.zip
netfilter: nf_tables: kill nft_validate_output_register()
All users of nft_validate_register_store() first invoke nft_validate_output_register(). There is in fact no use for using it on its own, so simplify the code by folding the functionality into nft_validate_register_store() and kill it. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_exthdr.c')
-rw-r--r--net/netfilter/nft_exthdr.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c
index ab16a3809628..8c4981cd813b 100644
--- a/net/netfilter/nft_exthdr.c
+++ b/net/netfilter/nft_exthdr.c
@@ -58,7 +58,6 @@ static int nft_exthdr_init(const struct nft_ctx *ctx,
const struct nlattr * const tb[])
{
struct nft_exthdr *priv = nft_expr_priv(expr);
- int err;
if (tb[NFTA_EXTHDR_DREG] == NULL ||
tb[NFTA_EXTHDR_TYPE] == NULL ||
@@ -69,11 +68,8 @@ static int nft_exthdr_init(const struct nft_ctx *ctx,
priv->type = nla_get_u8(tb[NFTA_EXTHDR_TYPE]);
priv->offset = ntohl(nla_get_be32(tb[NFTA_EXTHDR_OFFSET]));
priv->len = ntohl(nla_get_be32(tb[NFTA_EXTHDR_LEN]));
+ priv->dreg = ntohl(nla_get_be32(tb[NFTA_EXTHDR_DREG]));
- priv->dreg = ntohl(nla_get_be32(tb[NFTA_EXTHDR_DREG]));
- err = nft_validate_output_register(priv->dreg);
- if (err < 0)
- return err;
return nft_validate_register_store(ctx, priv->dreg, NULL,
NFT_DATA_VALUE, priv->len);
}