OSDN Git Service

mlxsw: spectrum_ipip: Handle underlay device change
authorPetr Machata <petrm@mellanox.com>
Fri, 3 Nov 2017 09:03:43 +0000 (10:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Nov 2017 00:15:18 +0000 (09:15 +0900)
When a bound device of an IP-in-IP tunnel changes, such as through
'ip tunnel change name $name dev $dev', the loopback backing the tunnel
needs to be recreated.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c

index 5f78fc5..7502e53 100644 (file)
@@ -326,8 +326,9 @@ mlxsw_sp_ipip_ol_netdev_change_gre4(struct mlxsw_sp *mlxsw_sp,
                }
 
                update_tunnel = true;
-       } else if (mlxsw_sp_ipip_parms_okey(ipip_entry->parms) !=
-                  mlxsw_sp_ipip_parms_okey(new_parms)) {
+       } else if ((mlxsw_sp_ipip_parms_okey(ipip_entry->parms) !=
+                   mlxsw_sp_ipip_parms_okey(new_parms)) ||
+                  ipip_entry->parms.link != new_parms.link) {
                update_tunnel = true;
        } else if (!mlxsw_sp_l3addr_eq(&new_daddr, &old_daddr)) {
                update_nhs = true;