From 55d46df4be5945a5294f6909d151936648895db7 Mon Sep 17 00:00:00 2001 From: Arthur de Kerhor Date: Thu, 17 Jun 2021 09:34:12 +0200 Subject: fib: changing parsing order to avoid corner case mfib interface flags are parsed before the interface name. For some specific names, this creates a bug when adding routes. ex: ip route add 10.0.2.0/24 via FortyGigabitEthernetd8/0/0 The 'F' at the beginnig of the interface name is parsed as the "Forward" flag. Because of that, the interface name parsed is "ortyGigabitEthernetd8/0/0" which results in a parsing error. Type: fix Signed-off-by: Arthur de Kerhor Change-Id: Ib76c2f86416455841f910f7b466b467001072b70 --- src/vnet/fib/fib_types.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c index 2fce6a85c74..e2b8df79e63 100644 --- a/src/vnet/fib/fib_types.c +++ b/src/vnet/fib/fib_types.c @@ -715,9 +715,6 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args) rpath->frp_weight = 1; rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL; } - else if (unformat (input, "%U", - unformat_mfib_itf_flags, &rpath->frp_mitf_flags)) - ; else if (unformat (input, "out-labels")) { while (unformat (input, "%U", @@ -735,6 +732,9 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args) { rpath->frp_proto = *payload_proto; } + else if (unformat (input, "%U", + unformat_mfib_itf_flags, &rpath->frp_mitf_flags)) + ; else if (unformat (input, "via")) { /* new path, back up and return */ -- cgit 1.2.3-korg