diff options
author | Petr Machata <petrm@mellanox.com> | 2017-11-03 10:03:39 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-04 09:15:17 +0900 |
commit | 4526cc8aed2b4bf481709911fc1fee9f040ccda1 (patch) | |
tree | 689d07dfd6567feef07464b666ddd4fcaa11c84a /drivers/net/ethernet | |
parent | 0c5f1cd5ba8c03567c67910816a7a0fb9fee5746 (diff) |
mlxsw: spectrum_router: Fix saddr deduction in mlxsw_sp_ipip_entry_create()
When trying to determine whether there are other offloaded tunnels with
the same local address, mlxsw_sp_ipip_entry_create() should look for a
tunnel with matching UL protocol, matching saddr, in the same VRF.
However instead of taking into account the UL protocol of the tunnel
netdevice (which mlxsw_sp_ipip_entry_saddr_matches() then compares to
the UL protocol of inspected IPIP entry), it deduces the UL protocol
from the inspected IPIP entry (and that's compared to itself).
This is currently immaterial, because only one tunnel type is offloaded,
and therefore the UL protocol always matches, but introducing support
for a tunnel with IPv6 underlay would uncover this error.
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 1376a9738b3c..897a3841e52f 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -1169,10 +1169,10 @@ mlxsw_sp_ipip_entry_create(struct mlxsw_sp *mlxsw_sp, * in the same underlay table needs special treatment in the HW. That is * currently not implemented in the driver. */ + ul_proto = router->ipip_ops_arr[ipipt]->ul_proto; + saddr = mlxsw_sp_ipip_netdev_saddr(ul_proto, ol_dev); list_for_each_entry(ipip_entry, &mlxsw_sp->router->ipip_list, ipip_list_node) { - ul_proto = router->ipip_ops_arr[ipip_entry->ipipt]->ul_proto; - saddr = mlxsw_sp_ipip_netdev_saddr(ul_proto, ol_dev); if (mlxsw_sp_ipip_entry_saddr_matches(mlxsw_sp, ul_proto, saddr, ul_tb_id, ipip_entry)) return ERR_PTR(-EEXIST); |