netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vxlan nits
@ 2012-10-19 11:46 David L Stevens
  2012-10-19 20:28 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: David L Stevens @ 2012-10-19 11:46 UTC (permalink / raw)
  To: Stephen Hemminger, David Miller; +Cc: netdev


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;
 		}

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

end of thread, other threads:[~2012-10-29 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 11:46 [PATCH] vxlan nits David L Stevens
2012-10-19 20:28 ` Stephen Hemminger
2012-10-28 22:02   ` Vincent Bernat
2012-10-29 14:20     ` Stephen Hemminger

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