Skip to contentSkip to conversation

net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2

PATCH Superseded Dmitry Safonov 2 participants 3 messages Feb 23, 2022 – Feb 25, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2

The following build-error on my config:
net/ipv6/ip6mr.c: In function ‘ip6_mroute_setsockopt’:
net/ipv6/ip6mr.c:1656:14: error: unused variable ‘do_wrmifwhole’ [-Werror=unused-variable]
1656 | bool do_wrmifwhole;
| ^

Cc Mobashshera Rasool <[email protected]>
Cc David S. Miller <[email protected]>
Cc Hideaki YOSHIFUJI <[email protected]>
Cc David Ahern <[email protected]>
Cc Jakub Kicinski <[email protected]>
Fixes 4b340a5a726d
---
 net/ipv6/ip6mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6mr.c +1 -1
index a9775c830194..4e74bc61a3db 100644
@@ -1653,7 +1653,6 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 	mifi_t mifi;
 	struct net *net = sock_net(sk);
 	struct mr_table *mrt;
-	bool do_wrmifwhole;
 
 	if (sk->sk_type != SOCK_RAW ||
 	    inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
@@ -1761,6 +1760,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 #ifdef CONFIG_IPV6_PIMSM_V2
 	case MRT6_PIM:
 	{
+		bool do_wrmifwhole;
 		int v;
 
 		if (optlen != sizeof(v))

base-commit: 922ea87ff6f2b63f413c6afa2c25b287dce76639

Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 21 lines · Dmitry Safonov
net/ipv6/ip6mr.c +1 -1
index a9775c830194..4e74bc61a3db 100644
@@ -1653,7 +1653,6 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 	mifi_t mifi;
 	struct net *net = sock_net(sk);
 	struct mr_table *mrt;
-	bool do_wrmifwhole;
 
 	if (sk->sk_type != SOCK_RAW ||
 	    inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
@@ -1761,6 +1760,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 #ifdef CONFIG_IPV6_PIMSM_V2
 	case MRT6_PIM:
 	{
+		bool do_wrmifwhole;
 		int v;
 
 		if (optlen != sizeof(v))
Quoted 1 line

base-commit: 922ea87ff6f2b63f413c6afa2c25b287dce76639

you could do one better and move it under the
'if (v != mrt->mroute_do_pim) {'

so that the do_wrmifwhole check is only done when needed

#2 lore raw
Quoted 20 lines · David Ahern
Quoted 19 lines · Dmitry Safonov
net/ipv6/ip6mr.c +1 -1
index a9775c830194..4e74bc61a3db 100644
@@ -1653,7 +1653,6 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 	mifi_t mifi;
 	struct net *net = sock_net(sk);
 	struct mr_table *mrt;
-	bool do_wrmifwhole;
 
 	if (sk->sk_type != SOCK_RAW ||
 	    inet_sk(sk)->inet_num != IPPROTO_ICMPV6)
@@ -1761,6 +1760,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 #ifdef CONFIG_IPV6_PIMSM_V2
 	case MRT6_PIM:
 	{
+		bool do_wrmifwhole;
 		int v;
 
Quoted 8 lines
Quoted 3 lines
net/ipv6/ip6mr.c +0 -0
 		if (optlen != sizeof(v))

base-commit: 922ea87ff6f2b63f413c6afa2c25b287dce76639

you could do one better and move it under the
'if (v != mrt->mroute_do_pim) {'

so that the do_wrmifwhole check is only done when needed

I've tried to keep it simple and just to fix the build as I don't know which tests to run.
Anyway, I sent v2:
https://lore.kernel.org/all/[email protected]/T/#u

Is it what you meant?

Thanks,
Dmitry