Skip to contentSkip to conversation

netfilter: in nf_nat_initialized(), use const struct nf_conn *

PATCH Applied James Yonan 2 participants 2 messages Jun 29, 2022 – Jul 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: in nf_nat_initialized(), use const struct nf_conn *

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 *.

---
 include/net/netfilter/nf_nat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/netfilter/nf_nat.h +1 -1
index 987111ae5240..e9eb01e99d2f 100644
@@ -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)
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 5 lines · 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 *.

Applied, thanks