netfilter: nft_meta: set skb->nf_trace appropriately
authorLiping Zhang <liping.zhang@spreadtrum.com>
Wed, 8 Jun 2016 12:20:10 +0000 (20:20 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Jun 2016 12:15:33 +0000 (14:15 +0200)
When user add a nft rule to set nftrace to zero, for example:

  # nft add rule ip filter input nftrace set 0

We should set nf_trace to zero also.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_meta.c

index 16c50b0dd426840f79bda0bb3ebbd28ecb2845e5..f4bad9dc15c48b0d8635632dc50179457b5c49c1 100644 (file)
@@ -227,7 +227,7 @@ void nft_meta_set_eval(const struct nft_expr *expr,
                        skb->pkt_type = value;
                break;
        case NFT_META_NFTRACE:
-               skb->nf_trace = 1;
+               skb->nf_trace = !!value;
                break;
        default:
                WARN_ON(1);