Skip to content

Commit 1b8f717

Browse files
NicolasDichtelNipaLocal
authored andcommitted
ip6_tunnel: enable to change proto of fb tunnels
This is possible via the ioctl API: > ip -6 tunnel change ip6tnl0 mode any Let's align the netlink API: > ip link set ip6tnl0 type ip6tnl mode any Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent a42ee1f commit 1b8f717

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

net/ipv6/ip6_tunnel.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,8 +2053,17 @@ static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[],
20532053
struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
20542054
struct ip_tunnel_encap ipencap;
20552055

2056-
if (dev == ip6n->fb_tnl_dev)
2057-
return -EINVAL;
2056+
if (dev == ip6n->fb_tnl_dev) {
2057+
if (!data[IFLA_IPTUN_PROTO]) {
2058+
NL_SET_ERR_MSG(extack,
2059+
"Only protocol can be changed for fallback tunnel");
2060+
return -EINVAL;
2061+
}
2062+
2063+
ip6_tnl_netlink_parms(data, &p);
2064+
ip6_tnl0_update(netdev_priv(ip6n->fb_tnl_dev), &p);
2065+
return 0;
2066+
}
20582067

20592068
if (ip_tunnel_netlink_encap_parms(data, &ipencap)) {
20602069
int err = ip6_tnl_encap_setup(t, &ipencap);

0 commit comments

Comments
 (0)