aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorArthur de Kerhor <arthurdekerhor@gmail.com>2021-06-17 09:34:12 +0200
committerNeale Ranns <neale@graphiant.com>2021-06-17 10:32:56 +0000
commit55d46df4be5945a5294f6909d151936648895db7 (patch)
tree8b6fc244f7f6113ecbd018993ca566f3220869f5 /src/vnet/fib
parent91adf2449f23b9362fa6a07315e83548fe7c1c4b (diff)
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 <arthurdekerhor@gmail.com> Change-Id: Ib76c2f86416455841f910f7b466b467001072b70
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_types.c6
1 files 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 */