Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[linux-2.6-microblaze.git] / net / netfilter / nft_payload.c
index 47d4e0e..cb1c8c2 100644 (file)
@@ -144,10 +144,10 @@ static int nft_payload_init(const struct nft_ctx *ctx,
        priv->base   = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_BASE]));
        priv->offset = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_OFFSET]));
        priv->len    = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_LEN]));
-       priv->dreg   = nft_parse_register(tb[NFTA_PAYLOAD_DREG]);
 
-       return nft_validate_register_store(ctx, priv->dreg, NULL,
-                                          NFT_DATA_VALUE, priv->len);
+       return nft_parse_register_store(ctx, tb[NFTA_PAYLOAD_DREG],
+                                       &priv->dreg, NULL, NFT_DATA_VALUE,
+                                       priv->len);
 }
 
 static int nft_payload_dump(struct sk_buff *skb, const struct nft_expr *expr)
@@ -658,7 +658,6 @@ static int nft_payload_set_init(const struct nft_ctx *ctx,
        priv->base        = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_BASE]));
        priv->offset      = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_OFFSET]));
        priv->len         = ntohl(nla_get_be32(tb[NFTA_PAYLOAD_LEN]));
-       priv->sreg        = nft_parse_register(tb[NFTA_PAYLOAD_SREG]);
 
        if (tb[NFTA_PAYLOAD_CSUM_TYPE])
                priv->csum_type =
@@ -691,7 +690,8 @@ static int nft_payload_set_init(const struct nft_ctx *ctx,
                return -EOPNOTSUPP;
        }
 
-       return nft_validate_register_load(priv->sreg, priv->len);
+       return nft_parse_register_load(tb[NFTA_PAYLOAD_SREG], &priv->sreg,
+                                      priv->len);
 }
 
 static int nft_payload_set_dump(struct sk_buff *skb, const struct nft_expr *expr)