From patchwork Tue Oct 30 20:27:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Bernat X-Patchwork-Id: 195622 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 34DF32C007D for ; Wed, 31 Oct 2012 07:53:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757718Ab2J3UxB (ORCPT ); Tue, 30 Oct 2012 16:53:01 -0400 Received: from ftmxout01ba.infra.b2.fti.net ([193.252.121.124]:46613 "EHLO ftmxout01ba.infra.b2.fti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961Ab2J3UxA (ORCPT ); Tue, 30 Oct 2012 16:53:00 -0400 X-Greylist: delayed 901 seconds by postgrey-1.27 at vger.kernel.org; Tue, 30 Oct 2012 16:53:00 EDT X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 From: Vincent Bernat To: Stephen Hemminger , David Miller , netdev@vger.kernel.org Cc: Vincent Bernat Subject: [PATCH] vxlan: allow a user to set TTL value Date: Tue, 30 Oct 2012 21:27:16 +0100 Message-Id: <1351628836-23094-1-git-send-email-bernat@luffy.cx> X-Mailer: git-send-email 1.7.10.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org "ip link add ... type vxlan ... ttl X" allows a user to set the TTL used by a VXLAN for encapsulation. The provided value was ignored by vxlan module and the default value of 1 was used when encapsulating multicast packets. Signed-off-by: Vincent Bernat Acked-by: Stephen Hemminger --- drivers/net/vxlan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 607976c..030559d 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1107,6 +1107,9 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, if (data[IFLA_VXLAN_TOS]) vxlan->tos = nla_get_u8(data[IFLA_VXLAN_TOS]); + if (data[IFLA_VXLAN_TTL]) + vxlan->ttl = nla_get_u8(data[IFLA_VXLAN_TTL]); + if (!data[IFLA_VXLAN_LEARNING] || nla_get_u8(data[IFLA_VXLAN_LEARNING])) vxlan->learn = true;