summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Bernat <bernat@luffy.cx>2012-10-30 10:27:16 +0000
committerDavid S. Miller <davem@davemloft.net>2012-11-03 15:24:01 -0400
commitafb97186f5d8f1d552298e7423e84c4282e48b92 (patch)
tree33d1d3e81d46b0de46a248167615374bf52ed4c0
parent899a391b75d36b6c46ad2de006b2343cd29edc06 (diff)
downloadblackbird-op-linux-afb97186f5d8f1d552298e7423e84c4282e48b92.tar.gz
blackbird-op-linux-afb97186f5d8f1d552298e7423e84c4282e48b92.zip
vxlan: allow a user to set TTL value
"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 <bernat@luffy.cx> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/vxlan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 607976c00162..030559dbeb3c 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;
OpenPOWER on IntegriCloud