All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: David L Stevens <dlstevens@us.ibm.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] vxlan nits
Date: Fri, 19 Oct 2012 13:28:15 -0700	[thread overview]
Message-ID: <20121019132815.547a5bb8@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <201210191148.q9JBkm0v018443@lab1.dls>

On Fri, 19 Oct 2012 07:46:48 -0400
David L Stevens <dlstevens@us.ibm.com> wrote:

> 
> This patch fixes a couple problems with vxlan.
> 
> 1) Improper check of NUD_PERMANENT makes permanent forwarding table
> 	entries timeout too.
> 
> 2) Check for "0.0.0.0" as gaddr and allow to mean "no group". The
> 	iproute2 patch sends gaddr even if not specified, which
> 	fails the IN_MULTICAST() test. This patch allows static-only
> 	forwarding and dropping everything else.
> 
> Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 607976c..3fac9f3 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -816,7 +816,7 @@ static void vxlan_cleanup(unsigned long arg)
>  				= container_of(p, struct vxlan_fdb, hlist);
>  			unsigned long timeout;
>  
> -			if (f->state == NUD_PERMANENT)
> +			if (f->state & NUD_PERMANENT)
>  				continue;
>  
>  			timeout = f->used + vxlan->age_interval * HZ;
> @@ -1047,7 +1047,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[])
>  
>  	if (data[IFLA_VXLAN_GROUP]) {
>  		__be32 gaddr = nla_get_be32(data[IFLA_VXLAN_GROUP]);
> -		if (!IN_MULTICAST(ntohl(gaddr))) {
> +		if (gaddr && !IN_MULTICAST(ntohl(gaddr))) {
>  			pr_debug("group address is not IPv4 multicast\n");
>  			return -EADDRNOTAVAIL;
>  		}
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

The first is a bug, the second doesn't need to be fixed in the kernel.
I change iproute to not sent group address unless it is defined.

The plan is to add IPV6 support, in which case group address could
be IPV6.

  reply	other threads:[~2012-10-19 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 11:46 [PATCH] vxlan nits David L Stevens
2012-10-19 20:28 ` Stephen Hemminger [this message]
2012-10-28 22:02   ` Vincent Bernat
2012-10-29 14:20     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121019132815.547a5bb8@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=dlstevens@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.