Skip to contentSkip to conversation

vxlan nits

PATCH In review David L Stevens 3 participants 4 messages Oct 19, 2012 – Oct 29, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxlan nits

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.

drivers/net/vxlan.c +2 -2
index 607976c..3fac9f3 100644
@@ -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;
 		}
#1 lore raw
Quoted 37 lines · On Fri, 19 Oct 2012 07:46:48 -0400 David L Stevens <[email protected]> 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.

drivers/net/vxlan.c +2 -3
index 607976c..3fac9f3 100644
@@ -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;
 		}
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
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.

#2 lore raw

❦ 19 octobre 2012 22:28 CEST, Stephen Hemminger <[email protected]> :

Quoted 2 lines

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

Hi Stephen!

Is it something that you plan to add soon?

Signature · 2 lines
printk(KERN_ERR "msp3400: chip reset failed, penguin on i2c bus?\n");
	2.2.16 /usr/src/linux/drivers/char/msp3400.c
#3 lore raw
Quoted 8 lines · On Sun, 28 Oct 2012 23:02:20 +0100 Vincent Bernat <[email protected]> wrote:

❦ 19 octobre 2012 22:28 CEST, Stephen Hemminger <[email protected]> :

Quoted 2 lines

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

Hi Stephen!

Is it something that you plan to add soon?

The only real question is whether to have one driver do dual stack with one forwarding table, or separate drivers (like GRE). I prefer the former.

Since the RFC does not include IPv6 yet, there is no rush and the final standard may address some of the corner case issues like fragmentation.