Skip to content

Commit 10d3757

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Allow programming link-local prefix routes
The device has a trap for IPv6 packets that need be routed and have a unicast link-local destination IP (i.e., fe80::/10). This allows mlxsw to ignore link-local routes, as the packets will be trapped to the CPU in any case. However, since link-local routes are not programmed, it is possible for routed packets to hit the default route which might also be programmed to trap packets. This means that packets with a link-local destination IP might be trapped for the wrong reason. To overcome this, allow programming link-local prefix routes (usually one fe80::/64 per-table), so that the packets will be forwarded until reaching the link-local trap. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9785b92 commit 10d3757

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5003,9 +5003,11 @@ static bool mlxsw_sp_fib6_rt_should_ignore(const struct fib6_info *rt)
50035003
{
50045004
/* Packets with link-local destination IP arriving to the router
50055005
* are trapped to the CPU, so no need to program specific routes
5006-
* for them.
5006+
* for them. Only allow prefix routes (usually one fe80::/64) so
5007+
* that packets are trapped for the right reason.
50075008
*/
5008-
if (ipv6_addr_type(&rt->fib6_dst.addr) & IPV6_ADDR_LINKLOCAL)
5009+
if ((ipv6_addr_type(&rt->fib6_dst.addr) & IPV6_ADDR_LINKLOCAL) &&
5010+
(rt->fib6_flags & (RTF_LOCAL | RTF_ANYCAST)))
50095011
return true;
50105012

50115013
/* Multicast routes aren't supported, so ignore them. Neighbour

0 commit comments

Comments
 (0)