Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723226 > unrolled thread

[PATCH] netfilter: nat: constify rhashtable_params

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-30 13:50 +0200
Last post2017-09-08 19:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: nat: constify rhashtable_params Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-30 13:50 +0200
    Re: [PATCH] netfilter: nat: constify rhashtable_params Pablo Neira Ayuso <pablo@netfilter.org> - 2017-09-08 13:50 +0200
      Re: [netfilter-core] [PATCH] netfilter: nat: constify  rhashtable_params Pablo Neira Ayuso <pablo@netfilter.org> - 2017-09-08 19:50 +0200

#1723226 — [PATCH] netfilter: nat: constify rhashtable_params

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-30 13:50 +0200
Subject[PATCH] netfilter: nat: constify rhashtable_params
Message-ID<uk9Fo-7Lr-17@gated-at.bofh.it>
rhashtable_params are not supposed to change at runtime. All
Functions rhashtable_* working with const rhashtable_params
provided by <linux/rhashtable.h>. So mark the non-const structs
as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 net/netfilter/nf_nat_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index eb54178..d1f355e 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -198,7 +198,7 @@ static int nf_nat_bysource_cmp(struct rhashtable_compare_arg *arg,
 	return 0;
 }
 
-static struct rhashtable_params nf_nat_bysource_params = {
+static const struct rhashtable_params nf_nat_bysource_params = {
 	.head_offset = offsetof(struct nf_conn, nat_bysource),
 	.obj_hashfn = nf_nat_bysource_hash,
 	.obj_cmpfn = nf_nat_bysource_cmp,
-- 
1.9.1

[toc] | [next] | [standalone]


#1728773

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2017-09-08 13:50 +0200
Message-ID<unpXk-6uQ-7@gated-at.bofh.it>
In reply to#1723226
On Wed, Aug 30, 2017 at 05:18:04PM +0530, Arvind Yadav wrote:
> rhashtable_params are not supposed to change at runtime. All
> Functions rhashtable_* working with const rhashtable_params
> provided by <linux/rhashtable.h>. So mark the non-const structs
> as const.

Applied to nf, thanks.

[toc] | [prev] | [next] | [standalone]


#1729133 — Re: [netfilter-core] [PATCH] netfilter: nat: constify rhashtable_params

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2017-09-08 19:50 +0200
SubjectRe: [netfilter-core] [PATCH] netfilter: nat: constify rhashtable_params
Message-ID<unvzI-1IV-15@gated-at.bofh.it>
In reply to#1728773
On Fri, Sep 08, 2017 at 01:46:30PM +0200, Pablo Neira Ayuso wrote:
> On Wed, Aug 30, 2017 at 05:18:04PM +0530, Arvind Yadav wrote:
> > rhashtable_params are not supposed to change at runtime. All
> > Functions rhashtable_* working with const rhashtable_params
> > provided by <linux/rhashtable.h>. So mark the non-const structs
> > as const.
> 
> Applied to nf, thanks.

Actually, I tossed this. NAT rhashtable has been reverted, so no need
for this constification anymore.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web