* [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops
@ 2017-08-26 10:41 Arvind Yadav
2017-08-26 10:45 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-26 10:41 UTC (permalink / raw)
To: pablo, kadlec, fw, davem, kuznet, yoshfuji
Cc: linux-kernel, coreteam, netfilter-devel, netdev
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops
2017-08-26 10:41 [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops Arvind Yadav
@ 2017-08-26 10:45 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2017-08-26 10:45 UTC (permalink / raw)
To: Arvind Yadav
Cc: pablo, kadlec, fw, davem, kuznet, yoshfuji, linux-kernel,
coreteam, netfilter-devel, netdev
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-26 10:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-26 10:41 [PATCH] netfilter: ipv4: nf_defrag: constify nf_hook_ops Arvind Yadav
2017-08-26 10:45 ` Florian Westphal
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).