diff options
author | Florian Westphal <fw@strlen.de> | 2016-04-12 18:14:25 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-04-18 20:39:48 +0200 |
commit | adff6c65600000ec2bb71840c943ee12668080f5 (patch) | |
tree | 4d997d6be491c820c95302299034d62f55c8387d /net/netfilter/xt_connlabel.c | |
parent | 5a8145f7b22269adaf9e98b160a20486d1ad5669 (diff) | |
download | linux-stable-adff6c65600000ec2bb71840c943ee12668080f5.tar.gz linux-stable-adff6c65600000ec2bb71840c943ee12668080f5.tar.bz2 linux-stable-adff6c65600000ec2bb71840c943ee12668080f5.zip |
netfilter: connlabels: change nf_connlabels_get bit arg to 'highest used'
nf_connlabel_set() takes the bit number that we would like to set.
nf_connlabels_get() however took the number of bits that we want to
support.
So e.g. nf_connlabels_get(32) support bits 0 to 31, but not 32.
This changes nf_connlabels_get() to take the highest bit that we want
to set.
Callers then don't have to cope with a potential integer wrap
when using nf_connlabels_get(bit + 1) anymore.
Current callers are fine, this change is only to make folloup
nft ct label set support simpler.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/xt_connlabel.c')
-rw-r--r-- | net/netfilter/xt_connlabel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_connlabel.c b/net/netfilter/xt_connlabel.c index d9b3e535d13a..a79af255561a 100644 --- a/net/netfilter/xt_connlabel.c +++ b/net/netfilter/xt_connlabel.c @@ -65,7 +65,7 @@ static int connlabel_mt_check(const struct xt_mtchk_param *par) return ret; } - ret = nf_connlabels_get(par->net, info->bit + 1); + ret = nf_connlabels_get(par->net, info->bit); if (ret < 0) nf_ct_l3proto_module_put(par->family); return ret; |