netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: nat: constify rhashtable_params
@ 2017-08-30 11:48 Arvind Yadav
  2017-09-08 11:46 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-08-30 11:48 UTC (permalink / raw)
  To: davem, fw, kadlec, pablo; +Cc: linux-kernel, netdev, coreteam, netfilter-devel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: nat: constify rhashtable_params
  2017-08-30 11:48 [PATCH] netfilter: nat: constify rhashtable_params Arvind Yadav
@ 2017-09-08 11:46 ` Pablo Neira Ayuso
  2017-09-08 17:47   ` [netfilter-core] " Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Neira Ayuso @ 2017-09-08 11:46 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: davem, fw, kadlec, linux-kernel, netdev, coreteam, netfilter-devel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [netfilter-core] [PATCH] netfilter: nat: constify rhashtable_params
  2017-09-08 11:46 ` Pablo Neira Ayuso
@ 2017-09-08 17:47   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2017-09-08 17:47 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: netdev, linux-kernel, coreteam, netfilter-devel, kadlec, davem

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-08 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 11:48 [PATCH] netfilter: nat: constify rhashtable_params Arvind Yadav
2017-09-08 11:46 ` Pablo Neira Ayuso
2017-09-08 17:47   ` [netfilter-core] " Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).