All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: in nf_nat_initialized(), use const struct nf_conn *
@ 2022-06-29 19:22 James Yonan
  2022-07-11 14:40 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: James Yonan @ 2022-06-29 19:22 UTC (permalink / raw)
  To: netfilter-devel; +Cc: James Yonan

nf_nat_initialized() doesn't modify passed struct nf_conn,
so declare as const.

This is helpful for code readability and makes it possible
to call nf_nat_initialized() with a const struct nf_conn *.

Signed-off-by: James Yonan <james@openvpn.net>
---
 include/net/netfilter/nf_nat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 987111ae5240..e9eb01e99d2f 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -104,7 +104,7 @@ unsigned int
 nf_nat_inet_fn(void *priv, struct sk_buff *skb,
 	       const struct nf_hook_state *state);
 
-static inline int nf_nat_initialized(struct nf_conn *ct,
+static inline int nf_nat_initialized(const struct nf_conn *ct,
 				     enum nf_nat_manip_type manip)
 {
 	if (manip == NF_NAT_MANIP_SRC)
-- 
2.25.1


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

* Re: [PATCH] netfilter: in nf_nat_initialized(), use const struct nf_conn *
  2022-06-29 19:22 [PATCH] netfilter: in nf_nat_initialized(), use const struct nf_conn * James Yonan
@ 2022-07-11 14:40 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2022-07-11 14:40 UTC (permalink / raw)
  To: James Yonan; +Cc: netfilter-devel

On Wed, Jun 29, 2022 at 01:22:10PM -0600, James Yonan wrote:
> nf_nat_initialized() doesn't modify passed struct nf_conn,
> so declare as const.
> 
> This is helpful for code readability and makes it possible
> to call nf_nat_initialized() with a const struct nf_conn *.

Applied, thanks

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

end of thread, other threads:[~2022-07-11 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 19:22 [PATCH] netfilter: in nf_nat_initialized(), use const struct nf_conn * James Yonan
2022-07-11 14:40 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.