netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups
@ 2012-12-20 13:36 Yan Burman
  2012-12-20 16:26 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yan Burman @ 2012-12-20 13:36 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, ogerlitz, Yan Burman

The socket calls from vxlan to join/leave multicast group aren't
using the index of the underlying device, as a result the stack uses
the first interface that is up. This results in vxlan being non functional
over a device which isn't the 1st to be up.
Fix this by providing the iflink field to the vxlan instance
to the multicast calls.

Signed-off-by: Yan Burman <yanb@mellanox.com>
---
 drivers/net/vxlan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 3b3fdf6..40f2cc1 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -505,7 +505,8 @@ static int vxlan_join_group(struct net_device *dev)
 	struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
 	struct sock *sk = vn->sock->sk;
 	struct ip_mreqn mreq = {
-		.imr_multiaddr.s_addr = vxlan->gaddr,
+		.imr_multiaddr.s_addr	= vxlan->gaddr,
+		.imr_ifindex		= vxlan->link,
 	};
 	int err;
 
@@ -532,7 +533,8 @@ static int vxlan_leave_group(struct net_device *dev)
 	int err = 0;
 	struct sock *sk = vn->sock->sk;
 	struct ip_mreqn mreq = {
-		.imr_multiaddr.s_addr = vxlan->gaddr,
+		.imr_multiaddr.s_addr	= vxlan->gaddr,
+		.imr_ifindex		= vxlan->link,
 	};
 
 	/* Only leave group when last vxlan is done. */
-- 
1.7.11.3

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

* Re: [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups
  2012-12-20 13:36 [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups Yan Burman
@ 2012-12-20 16:26 ` Stephen Hemminger
  2012-12-26 23:10 ` David Miller
       [not found] ` <20130114004652.GA11597@fliwatuet.svr02.mucip.net>
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2012-12-20 16:26 UTC (permalink / raw)
  To: Yan Burman; +Cc: netdev, ogerlitz

On Thu, 20 Dec 2012 15:36:08 +0200
Yan Burman <yanb@mellanox.com> wrote:

> The socket calls from vxlan to join/leave multicast group aren't
> using the index of the underlying device, as a result the stack uses
> the first interface that is up. This results in vxlan being non functional
> over a device which isn't the 1st to be up.
> Fix this by providing the iflink field to the vxlan instance
> to the multicast calls.
> 
> Signed-off-by: Yan Burman <yanb@mellanox.com>
> ---
>  drivers/net/vxlan.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 3b3fdf6..40f2cc1 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -505,7 +505,8 @@ static int vxlan_join_group(struct net_device *dev)
>  	struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
>  	struct sock *sk = vn->sock->sk;
>  	struct ip_mreqn mreq = {
> -		.imr_multiaddr.s_addr = vxlan->gaddr,
> +		.imr_multiaddr.s_addr	= vxlan->gaddr,
> +		.imr_ifindex		= vxlan->link,
>  	};
>  	int err;
>  
> @@ -532,7 +533,8 @@ static int vxlan_leave_group(struct net_device *dev)
>  	int err = 0;
>  	struct sock *sk = vn->sock->sk;
>  	struct ip_mreqn mreq = {
> -		.imr_multiaddr.s_addr = vxlan->gaddr,
> +		.imr_multiaddr.s_addr	= vxlan->gaddr,
> +		.imr_ifindex		= vxlan->link,
>  	};
>  
>  	/* Only leave group when last vxlan is done. */

Acked-by: Stephen Hemminger <shemminger@vyatta.com>

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

* Re: [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups
  2012-12-20 13:36 [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups Yan Burman
  2012-12-20 16:26 ` Stephen Hemminger
@ 2012-12-26 23:10 ` David Miller
       [not found] ` <20130114004652.GA11597@fliwatuet.svr02.mucip.net>
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-12-26 23:10 UTC (permalink / raw)
  To: yanb; +Cc: shemminger, netdev, ogerlitz

From: Yan Burman <yanb@mellanox.com>
Date: Thu, 20 Dec 2012 15:36:08 +0200

> The socket calls from vxlan to join/leave multicast group aren't
> using the index of the underlying device, as a result the stack uses
> the first interface that is up. This results in vxlan being non functional
> over a device which isn't the 1st to be up.
> Fix this by providing the iflink field to the vxlan instance
> to the multicast calls.
> 
> Signed-off-by: Yan Burman <yanb@mellanox.com>

Applied, thanks.

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

* RE: [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups
       [not found] ` <20130114004652.GA11597@fliwatuet.svr02.mucip.net>
@ 2013-01-17 15:19   ` Yan Burman
  0 siblings, 0 replies; 4+ messages in thread
From: Yan Burman @ 2013-01-17 15:19 UTC (permalink / raw)
  To: Bernhard Schmidt; +Cc: David Miller, netdev


> -----Original Message-----
> From: Bernhard Schmidt [mailto:berni@birkenwald.de]
> Sent: Monday, January 14, 2013 02:48
> To: Yan Burman
> Subject: Re: [PATCH net] net/vxlan: Use the underlying device index when
> joining/leaving multicast groups
> 
> In gmane.linux.network, Yan Burman wrote:
> 
> Hello,
> 
> thanks! That fixes my issue. Could you please submit this to -stable?
> 

>From my understanding David is the one submitting to -stable.
I can send it to -stable assuming it's ok with David.

Yan

> Thanks,
> Bernhard
> 
> > The socket calls from vxlan to join/leave multicast group aren't using
> > the index of the underlying device, as a result the stack uses the
> > first interface that is up. This results in vxlan being non functional
> > over a device which isn't the 1st to be up.
> > Fix this by providing the iflink field to the vxlan instance to the
> > multicast calls.
> >
> > Signed-off-by: Yan Burman <yanb@mellanox.com>
> > ---
> >  drivers/net/vxlan.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index
> > 3b3fdf6..40f2cc1 100644
> > --- a/drivers/net/vxlan.c
> > +++ b/drivers/net/vxlan.c
> > @@ -505,7 +505,8 @@ static int vxlan_join_group(struct net_device *dev)
> >  	struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
> >  	struct sock *sk = vn->sock->sk;
> >  	struct ip_mreqn mreq = {
> > -		.imr_multiaddr.s_addr = vxlan->gaddr,
> > +		.imr_multiaddr.s_addr	= vxlan->gaddr,
> > +		.imr_ifindex		= vxlan->link,
> >  	};
> >  	int err;
> >
> > @@ -532,7 +533,8 @@ static int vxlan_leave_group(struct net_device
> *dev)
> >  	int err = 0;
> >  	struct sock *sk = vn->sock->sk;
> >  	struct ip_mreqn mreq = {
> > -		.imr_multiaddr.s_addr = vxlan->gaddr,
> > +		.imr_multiaddr.s_addr	= vxlan->gaddr,
> > +		.imr_ifindex		= vxlan->link,
> >  	};
> >
> >  	/* Only leave group when last vxlan is done. */
> > --
> > 1.7.11.3
> >

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

end of thread, other threads:[~2013-01-17 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 13:36 [PATCH net] net/vxlan: Use the underlying device index when joining/leaving multicast groups Yan Burman
2012-12-20 16:26 ` Stephen Hemminger
2012-12-26 23:10 ` David Miller
     [not found] ` <20130114004652.GA11597@fliwatuet.svr02.mucip.net>
2013-01-17 15:19   ` Yan Burman

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