* [PATCH v2 net-next] mlxsw: spectrum_router: Prevent ipv6 gateway with v4 route via replace and append
@ 2019-04-23 23:03 David Ahern
2019-04-24 2:54 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2019-04-23 23:03 UTC (permalink / raw)
To: davem; +Cc: netdev, idosch, David Ahern
From: David Ahern <dsahern@gmail.com>
mlxsw currently does not support v6 gateways with v4 routes. Commit
19a9d136f198 ("ipv4: Flag fib_info with a fib_nh using IPv6 gateway")
prevents a route from being added, but nothing stops the replace or
append. Add a catch for them too.
$ ip ro add 172.16.2.0/24 via 10.99.1.2
$ ip ro replace 172.16.2.0/24 via inet6 fe80::202:ff:fe00:b dev swp1s0
Error: mlxsw_spectrum: IPv6 gateway with IPv4 route is not supported.
$ ip ro append 172.16.2.0/24 via inet6 fe80::202:ff:fe00:b dev swp1s0
Error: mlxsw_spectrum: IPv6 gateway with IPv4 route is not supported.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
v2
- added catch for append and moved up location to ADD case
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 8f31c2ddc538..1cda8a248b12 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -6105,6 +6105,8 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
return notifier_from_errno(err);
break;
case FIB_EVENT_ENTRY_ADD:
+ case FIB_EVENT_ENTRY_REPLACE: /* fall through */
+ case FIB_EVENT_ENTRY_APPEND: /* fall through */
if (router->aborted) {
NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was aborted. Not configuring route");
return notifier_from_errno(-EINVAL);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net-next] mlxsw: spectrum_router: Prevent ipv6 gateway with v4 route via replace and append
2019-04-23 23:03 [PATCH v2 net-next] mlxsw: spectrum_router: Prevent ipv6 gateway with v4 route via replace and append David Ahern
@ 2019-04-24 2:54 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-04-24 2:54 UTC (permalink / raw)
To: dsahern; +Cc: netdev, idosch, dsahern
From: David Ahern <dsahern@kernel.org>
Date: Tue, 23 Apr 2019 16:03:29 -0700
> From: David Ahern <dsahern@gmail.com>
>
> mlxsw currently does not support v6 gateways with v4 routes. Commit
> 19a9d136f198 ("ipv4: Flag fib_info with a fib_nh using IPv6 gateway")
> prevents a route from being added, but nothing stops the replace or
> append. Add a catch for them too.
> $ ip ro add 172.16.2.0/24 via 10.99.1.2
> $ ip ro replace 172.16.2.0/24 via inet6 fe80::202:ff:fe00:b dev swp1s0
> Error: mlxsw_spectrum: IPv6 gateway with IPv4 route is not supported.
> $ ip ro append 172.16.2.0/24 via inet6 fe80::202:ff:fe00:b dev swp1s0
> Error: mlxsw_spectrum: IPv6 gateway with IPv4 route is not supported.
>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
> v2
> - added catch for append and moved up location to ADD case
Applied, thanks David.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-24 2:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 23:03 [PATCH v2 net-next] mlxsw: spectrum_router: Prevent ipv6 gateway with v4 route via replace and append David Ahern
2019-04-24 2:54 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.