linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2
@ 2022-02-25 14:52 Dmitry Safonov
  2022-02-25 15:32 ` David Ahern
  2022-02-27 19:51 ` Cong Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Safonov @ 2022-02-25 14:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dmitry Safonov, Dmitry Safonov, Mobashshera Rasool,
	David S. Miller, Hideaki YOSHIFUJI, David Ahern, Jakub Kicinski,
	netdev

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 <mobash.rasool.linux@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: David Ahern <dsahern@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
Fixes: 4b340a5a726d
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
v2: move the (v == MRT6MSG_WRMIFWHOLE) check under if (v != mrt->mroute_do_pim)

 net/ipv6/ip6mr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index a9775c830194..9292f067c829 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -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_pim;
 		int v;
 
 		if (optlen != sizeof(v))
@@ -1768,14 +1768,14 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, sockptr_t optval,
 		if (copy_from_sockptr(&v, optval, sizeof(v)))
 			return -EFAULT;
 
-		do_wrmifwhole = (v == MRT6MSG_WRMIFWHOLE);
-		v = !!v;
+		do_pim = !!v;
+
 		rtnl_lock();
 		ret = 0;
-		if (v != mrt->mroute_do_pim) {
-			mrt->mroute_do_pim = v;
-			mrt->mroute_do_assert = v;
-			mrt->mroute_do_wrvifwhole = do_wrmifwhole;
+		if (do_pim != mrt->mroute_do_pim) {
+			mrt->mroute_do_pim = do_pim;
+			mrt->mroute_do_assert = do_pim;
+			mrt->mroute_do_wrvifwhole = (v == MRT6MSG_WRMIFWHOLE);
 		}
 		rtnl_unlock();
 		return ret;
-- 
2.35.1


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

* Re: [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2
  2022-02-25 14:52 [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2 Dmitry Safonov
@ 2022-02-25 15:32 ` David Ahern
  2022-02-27 19:51 ` Cong Wang
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2022-02-25 15:32 UTC (permalink / raw)
  To: Dmitry Safonov, linux-kernel
  Cc: Dmitry Safonov, Mobashshera Rasool, David S. Miller,
	Hideaki YOSHIFUJI, Jakub Kicinski, netdev

On 2/25/22 7:52 AM, Dmitry Safonov wrote:
> 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 <mobash.rasool.linux@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: David Ahern <dsahern@kernel.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: netdev@vger.kernel.org
> Fixes: 4b340a5a726d
> Signed-off-by: Dmitry Safonov <dima@arista.com>
> ---
> v2: move the (v == MRT6MSG_WRMIFWHOLE) check under if (v != mrt->mroute_do_pim)
> 
>  net/ipv6/ip6mr.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>


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

* Re: [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2
  2022-02-25 14:52 [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2 Dmitry Safonov
  2022-02-25 15:32 ` David Ahern
@ 2022-02-27 19:51 ` Cong Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Cong Wang @ 2022-02-27 19:51 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: linux-kernel, Dmitry Safonov, Mobashshera Rasool,
	David S. Miller, Hideaki YOSHIFUJI, David Ahern, Jakub Kicinski,
	netdev

On Fri, Feb 25, 2022 at 02:52:06PM +0000, Dmitry Safonov wrote:
> 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 <mobash.rasool.linux@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: David Ahern <dsahern@kernel.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: netdev@vger.kernel.org
> Fixes: 4b340a5a726d

Documentation/process/submitting-patches.rst:

If your patch fixes a bug in a specific commit, e.g. you found an issue using
``git bisect``, please use the 'Fixes:' tag with the first 12 characters of
the SHA-1 ID, and the one line summary.  Do not split the tag across multiple
lines, tags are exempt from the "wrap at 75 columns" rule in order to simplify
parsing scripts.  For example::

        Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed")

The following ``git config`` settings can be used to add a pretty format for
outputting the above style in the ``git log`` or ``git show`` commands::

        [core]
                abbrev = 12
        [pretty]
                fixes = Fixes: %h (\"%s\")



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

end of thread, other threads:[~2022-02-27 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 14:52 [PATCH net-next v2] net/ip6mr: Fix build with !CONFIG_IPV6_PIMSM_V2 Dmitry Safonov
2022-02-25 15:32 ` David Ahern
2022-02-27 19:51 ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).