netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge: simplify a br_multicast_query_received() function call
@ 2014-04-21 18:59 Linus Lüssing
  2014-04-23 18:47 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Lüssing @ 2014-04-21 18:59 UTC (permalink / raw)
  To: netdev
  Cc: bridge, Stephen Hemminger, David S. Miller, linux-kernel,
	Hannes Frederic Sowa, Linus Lüssing

The call from the IPv6 part can be simplified as the beginning of the
calling function ensures that we end up here when having a proper IPv6
source address only.

Introduced by 6565b9eeef194afbb3beec80d6dd2447f4091f8c
("bridge: multicast: add sanity check for query source addresses")

Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
 net/bridge/br_multicast.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 7b757b5..d2c3aae 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1282,8 +1282,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
 		goto out;
 	}
 
-	br_multicast_query_received(br, port, &br->ip6_querier,
-				    !ipv6_addr_any(&ip6h->saddr),
+	br_multicast_query_received(br, port, &br->ip6_querier, 1,
 				    is_general_query, max_delay);
 
 	if (!group)
-- 
1.7.10.4

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

* Re: [PATCH] bridge: simplify a br_multicast_query_received() function call
  2014-04-21 18:59 [PATCH] bridge: simplify a br_multicast_query_received() function call Linus Lüssing
@ 2014-04-23 18:47 ` David Miller
  2014-05-02  3:14   ` Linus Lüssing
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2014-04-23 18:47 UTC (permalink / raw)
  To: linus.luessing; +Cc: stephen, netdev, bridge, linux-kernel

From: Linus Lüssing <linus.luessing@web.de>
Date: Mon, 21 Apr 2014 20:59:35 +0200

> The call from the IPv6 part can be simplified as the beginning of the
> calling function ensures that we end up here when having a proper IPv6
> source address only.
> 
> Introduced by 6565b9eeef194afbb3beec80d6dd2447f4091f8c
> ("bridge: multicast: add sanity check for query source addresses")
> 
> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
>  net/bridge/br_multicast.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> index 7b757b5..d2c3aae 100644
> --- a/net/bridge/br_multicast.c
> +++ b/net/bridge/br_multicast.c
> @@ -1282,8 +1282,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
>  		goto out;
>  	}
>  
> -	br_multicast_query_received(br, port, &br->ip6_querier,
> -				    !ipv6_addr_any(&ip6h->saddr),
> +	br_multicast_query_received(br, port, &br->ip6_querier, 1,
>  				    is_general_query, max_delay);
>  
>  	if (!group)

This doesn't make any sense to me, is_general_query can be false at this
point.

Furthermore, even if your change would be correct, the argument is a
boolean not an integer.

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

* Re: [PATCH] bridge: simplify a br_multicast_query_received() function call
  2014-04-23 18:47 ` David Miller
@ 2014-05-02  3:14   ` Linus Lüssing
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Lüssing @ 2014-05-02  3:14 UTC (permalink / raw)
  To: David Miller; +Cc: stephen, netdev, bridge, linux-kernel

On Wed, Apr 23, 2014 at 02:47:48PM -0400, David Miller wrote:
> > --- a/net/bridge/br_multicast.c
> > +++ b/net/bridge/br_multicast.c
> > @@ -1282,8 +1282,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
> >  		goto out;
> >  	}
> >  
> > -	br_multicast_query_received(br, port, &br->ip6_querier,
> > -				    !ipv6_addr_any(&ip6h->saddr),
> > +	br_multicast_query_received(br, port, &br->ip6_querier, 1,
> >  				    is_general_query, max_delay);
> >  
> >  	if (!group)
> 
> This doesn't make any sense to me, is_general_query can be false at this
> point.

This change has nothing to do with is_general_query, the fifth
argument. I'm modifying the fourth, the is_saddr flag. As Hannes
has pointed out here [0], now that we make sure that we have a
link-local IPv6 address at the beginning of
br_ip6_multicast_query() this implies that the source address is
not '::'.

> 
> Furthermore, even if your change would be correct, the argument is a
> boolean not an integer.

Semantically yes. Syntactically the fourth argument is an integer
at the moment (unnecessarily). Should I change 'int saddr' to
'bool saddr' while at it, within the same patch?

Cheers

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

end of thread, other threads:[~2014-05-02  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 18:59 [PATCH] bridge: simplify a br_multicast_query_received() function call Linus Lüssing
2014-04-23 18:47 ` David Miller
2014-05-02  3:14   ` Linus Lüssing

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