From patchwork Fri Oct 19 11:46:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Stevens X-Patchwork-Id: 192660 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6E5D42C008F for ; Fri, 19 Oct 2012 22:49:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755880Ab2JSLtz (ORCPT ); Fri, 19 Oct 2012 07:49:55 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:47491 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751920Ab2JSLty (ORCPT ); Fri, 19 Oct 2012 07:49:54 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Oct 2012 05:49:51 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 19 Oct 2012 05:49:22 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 69E993E4003D for ; Fri, 19 Oct 2012 05:49:21 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9JBnLqr257860 for ; Fri, 19 Oct 2012 05:49:21 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9JBnKd7009772 for ; Fri, 19 Oct 2012 05:49:21 -0600 Received: from lab1.dls (sig-9-76-42-188.mts.ibm.com [9.76.42.188]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9JBnJ0E009686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Oct 2012 05:49:20 -0600 Received: from lab1.dls (lab1.dls [127.0.0.1]) by lab1.dls (8.14.5/8.14.5) with ESMTP id q9JBkm0v018443; Fri, 19 Oct 2012 07:48:08 -0400 Message-Id: <201210191148.q9JBkm0v018443@lab1.dls> To: Stephen Hemminger , David Miller cc: netdev@vger.kernel.org Subject: [PATCH] vxlan nits Date: Fri, 19 Oct 2012 07:46:48 -0400 From: David L Stevens X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12101911-7606-0000-0000-000004A185C3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 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; }