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


Groups > linux.kernel > #1720626 > unrolled thread

[PATCH] netfilter: ipv6: 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 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: ipv6: nf_defrag: constify nf_hook_ops Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-26 12:50 +0200

#1720626 — [PATCH] netfilter: ipv6: nf_defrag: constify nf_hook_ops

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-26 12:50 +0200
Subject[PATCH] netfilter: ipv6: nf_defrag: constify nf_hook_ops
Message-ID<uiGP8-8wn-11@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/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
index ada60d1..b326da5 100644
--- a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
+++ b/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
@@ -74,7 +74,7 @@ static unsigned int ipv6_defrag(void *priv,
 	return err == 0 ? NF_ACCEPT : NF_DROP;
 }
 
-static struct nf_hook_ops ipv6_defrag_ops[] = {
+static const struct nf_hook_ops ipv6_defrag_ops[] = {
 	{
 		.hook		= ipv6_defrag,
 		.pf		= NFPROTO_IPV6,
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web