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


Groups > linux.kernel > #1720624 > unrolled thread

[PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-26 12:50 +0200
Last post2017-08-26 12:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-26 12:50 +0200
    Re: [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops Florian Westphal <fw@strlen.de> - 2017-08-26 12:50 +0200

#1720624 — [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-26 12:50 +0200
Subject[PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops
Message-ID<uiGP7-8wn-7@gated-at.bofh.it>
nf_hook_ops are not supposed to change at runtime. nf_register_net_hooks
and nf_unregister_net_hooks are working with const nf_hook_ops.
So mark the non-const nf_hook_ops structs as const.

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

diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c
index 346bf7c..37fe1616 100644
--- a/net/ipv4/netfilter/nf_defrag_ipv4.c
+++ b/net/ipv4/netfilter/nf_defrag_ipv4.c
@@ -90,7 +90,7 @@ static unsigned int ipv4_conntrack_defrag(void *priv,
 	return NF_ACCEPT;
 }
 
-static struct nf_hook_ops ipv4_defrag_ops[] = {
+static const struct nf_hook_ops ipv4_defrag_ops[] = {
 	{
 		.hook		= ipv4_conntrack_defrag,
 		.pf		= NFPROTO_IPV4,
-- 
2.7.4

[toc] | [next] | [standalone]


#1720627

FromFlorian Westphal <fw@strlen.de>
Date2017-08-26 12:50 +0200
Message-ID<uiGP8-8wn-13@gated-at.bofh.it>
In reply to#1720624
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> nf_hook_ops are not supposed to change at runtime. nf_register_net_hooks
> and nf_unregister_net_hooks are working with const nf_hook_ops.
> So mark the non-const nf_hook_ops structs as const.

please update your nf-next tree, all nf_hook_ops are suppoed
to be const already.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web