Skip to contentSkip to conversation

bridge: Make br_is_nd_neigh_msg() accept pointer to "const struct sk_buff"

PATCH Superseded Ted Chen 2 participants 3 messages Jan 3, 2025 – Jan 4, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ted Chen

author
#0 lore raw

PATCH 1/1 bridge: Make br_is_nd_neigh_msg() accept pointer to "const struct sk_buff"

The skb_buff struct in br_is_nd_neigh_msg() is never modified. Mark it as const.

---
 net/bridge/br_arp_nd_proxy.c | 2 +-
 net/bridge/br_private.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/bridge/br_arp_nd_proxy.c +1 -1
index c7869a286df4..115a23054a58 100644
@@ -229,7 +229,7 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 #endif
 
 #if IS_ENABLED(CONFIG_IPV6)
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *msg)
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *msg)
 {
 	struct nd_msg *m;
 
net/bridge/br_private.h +1 -1
index 9853cfbb9d14..3fe432babfdf 100644
@@ -2290,6 +2290,6 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 			      u16 vid, struct net_bridge_port *p);
 void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
 		       u16 vid, struct net_bridge_port *p, struct nd_msg *msg);
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *m);
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *m);
 bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid);
 #endif
Signature · 1 line
2.39.2
#1 lore raw
Quoted 26 lines · Ted Chen

The skb_buff struct in br_is_nd_neigh_msg() is never modified. Mark it as const.

---
 net/bridge/br_arp_nd_proxy.c | 2 +-
 net/bridge/br_private.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/bridge/br_arp_nd_proxy.c +1 -1
index c7869a286df4..115a23054a58 100644
@@ -229,7 +229,7 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 #endif
 
 #if IS_ENABLED(CONFIG_IPV6)
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *msg)
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *msg)
 {
 	struct nd_msg *m;
 
net/bridge/br_private.h +0 -0
index 9853cfbb9d14..3fe432babfdf 100644

net/bridge/br_private.h void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br, · line 2295

Quoted 7 lines
net/bridge/br_private.h +1 -1
@@ -2290,6 +2290,6 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 			      u16 vid, struct net_bridge_port *p);
 void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
 		       u16 vid, struct net_bridge_port *p, struct nd_msg *msg);
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *m);
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *m);
 bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid);
 #endif

Hi,
This should be targeted at net-next (subject should be PATCH net-next). Also please try to keep commit message lines shorter, checkpatch flags this one as over 75 characters. You should wait 24 hours before posting v2 of the patch.

Other than that the patch is ok.

Cheers,
Nik

author
#2 lore raw
Quoted 41 lines · Nikolay Aleksandrov
Quoted 26 lines · Ted Chen

The skb_buff struct in br_is_nd_neigh_msg() is never modified. Mark it as const.

---
 net/bridge/br_arp_nd_proxy.c | 2 +-
 net/bridge/br_private.h      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/bridge/br_arp_nd_proxy.c +1 -1
index c7869a286df4..115a23054a58 100644
@@ -229,7 +229,7 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 #endif
 
 #if IS_ENABLED(CONFIG_IPV6)
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *msg)
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *msg)
 {
 	struct nd_msg *m;
 
net/bridge/br_private.h +0 -0
index 9853cfbb9d14..3fe432babfdf 100644

net/bridge/br_private.h void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br, · line 2295

Quoted 7 lines
net/bridge/br_private.h +1 -1
@@ -2290,6 +2290,6 @@ void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
 			      u16 vid, struct net_bridge_port *p);
 void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
 		       u16 vid, struct net_bridge_port *p, struct nd_msg *msg);
-struct nd_msg *br_is_nd_neigh_msg(struct sk_buff *skb, struct nd_msg *m);
+struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *m);
 bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid);
 #endif

Hi,
This should be targeted at net-next (subject should be PATCH net-next). Also please try to keep commit message lines shorter, checkpatch flags this one as over 75 characters. You should wait 24 hours before posting v2 of the patch.

Quoted 2 lines

Other than that the patch is ok.

Thank you for your kindly guidance!
v2 is at: https://lore.kernel.org/all/[email protected]

Ted