Skip to content

Commit 4ca257e

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains netfilter fixes for you net tree, they are: 1) Missing ct zone size in the nft_ct initialization path, patch from Florian Westphal. 2) Two patches for netfilter uapi headers, one to remove unnecessary sysctl.h inclusion and another to fix compilation of xt_hashlimit.h in userspace, from Dmitry V. Levin. 3) Patch to fix a sloppy change in nf_ct_expect that incorrectly simplified nf_ct_expect_related_report() in the previous nf-next batch. This also includes another patch for __nf_ct_expect_check() to report success by returning 0 to keep it consistent with other existing functions. From Jarno Rajahalme. 4) The ->walk() iterator of the new bitmap set type goes over the real bitmap size, this results in incorrect dumps when NFTA_SET_USERDATA is used. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 51fb60e + 13aa5a8 commit 4ca257e

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

include/uapi/linux/netfilter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <linux/types.h>
55
#include <linux/compiler.h>
6-
#include <linux/sysctl.h>
76
#include <linux/in.h>
87
#include <linux/in6.h>
98

include/uapi/linux/netfilter/xt_hashlimit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _UAPI_XT_HASHLIMIT_H
33

44
#include <linux/types.h>
5+
#include <linux/limits.h>
56
#include <linux/if.h>
67

78
/* timings are in milliseconds. */

net/netfilter/nf_conntrack_expect.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
410410
struct net *net = nf_ct_exp_net(expect);
411411
struct hlist_node *next;
412412
unsigned int h;
413-
int ret = 1;
413+
int ret = 0;
414414

415415
if (!master_help) {
416416
ret = -ESHUTDOWN;
@@ -460,14 +460,14 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
460460

461461
spin_lock_bh(&nf_conntrack_expect_lock);
462462
ret = __nf_ct_expect_check(expect);
463-
if (ret <= 0)
463+
if (ret < 0)
464464
goto out;
465465

466466
nf_ct_expect_insert(expect);
467467

468468
spin_unlock_bh(&nf_conntrack_expect_lock);
469469
nf_ct_expect_event_report(IPEXP_NEW, expect, portid, report);
470-
return ret;
470+
return 0;
471471
out:
472472
spin_unlock_bh(&nf_conntrack_expect_lock);
473473
return ret;

net/netfilter/nft_ct.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ static int nft_ct_set_init(const struct nft_ctx *ctx,
528528
if (!nft_ct_tmpl_alloc_pcpu())
529529
return -ENOMEM;
530530
nft_ct_pcpu_template_refcnt++;
531+
len = sizeof(u16);
531532
break;
532533
#endif
533534
default:

net/netfilter/nft_set_bitmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static int nft_bitmap_init(const struct nft_set *set,
258258
{
259259
struct nft_bitmap *priv = nft_set_priv(set);
260260

261-
priv->bitmap_size = nft_bitmap_total_size(set->klen);
261+
priv->bitmap_size = nft_bitmap_size(set->klen);
262262

263263
return 0;
264264
}

0 commit comments

Comments
 (0)