Skip to content

Commit afb9718

Browse files
vincentbernatdavem330
authored andcommitted
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 <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 899a391 commit afb9718

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/vxlan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,9 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,
11071107
if (data[IFLA_VXLAN_TOS])
11081108
vxlan->tos = nla_get_u8(data[IFLA_VXLAN_TOS]);
11091109

1110+
if (data[IFLA_VXLAN_TTL])
1111+
vxlan->ttl = nla_get_u8(data[IFLA_VXLAN_TTL]);
1112+
11101113
if (!data[IFLA_VXLAN_LEARNING] || nla_get_u8(data[IFLA_VXLAN_LEARNING]))
11111114
vxlan->learn = true;
11121115

0 commit comments

Comments
 (0)