diff options
author | Vladislav Grishenko <themiron@yandex-team.ru> | 2024-02-20 11:58:01 +0500 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2024-03-04 07:51:16 +0000 |
commit | dea806da536b8f1b49af9a852441d5f772f14486 (patch) | |
tree | 94daccd1dacd48c7851c9103399503b42491c963 /src/vnet | |
parent | eb5a08e91d3d7d0f9fc97aeedcbcc02b7a8b753a (diff) |
fib: fix crash while adding intf-rx routes
Fix crash while adding intf-rx ip4 and ip6 routes via api due
invalid exporting of interface rx routes as attached.
Also, add missed route path via rx-ip6 cli support.
Type: fix
Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
Change-Id: I15711c8c0787398dd7e3baa4787019bb1f317666
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/bier/bier_update.c | 9 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.c | 8 | ||||
-rw-r--r-- | src/vnet/fib/fib_types.h | 2 | ||||
-rw-r--r-- | src/vnet/ip/lookup.c | 2 | ||||
-rw-r--r-- | src/vnet/mpls/mpls.c | 8 | ||||
-rw-r--r-- | src/vnet/mpls/mpls_tunnel.c | 7 |
6 files changed, 31 insertions, 5 deletions
diff --git a/src/vnet/bier/bier_update.c b/src/vnet/bier/bier_update.c index 4108d09f51e..fdb7c5c0865 100644 --- a/src/vnet/bier/bier_update.c +++ b/src/vnet/bier/bier_update.c @@ -129,7 +129,14 @@ done: VLIB_CLI_COMMAND (bier_route_command) = { .path = "bier route", - .short_help = "bier route [add|del] sd <sud-domain> set <set> bsl <bit-string-length> bp <bit-position> via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]", + .short_help = + "bier route [add|del] sd <sud-domain> set <set> bsl <bit-string-length> " + "bp <bit-position> via [next-hop-address] [next-hop-interface] " + "[next-hop-table <value>] [weight <value>] [preference <value>] " + "[udp-encap-id <value>] [ip4-lookup-in-table <value>] " + "[ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] " + "[resolve-via-host] [resolve-via-connected] [rx-ip4|rx-ip6 <interface>] " + "[out-labels <value value value>]", .function = vnet_bier_route_cmd, }; diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c index 5c5fd0b9823..c4472c7122d 100644 --- a/src/vnet/fib/fib_types.c +++ b/src/vnet/fib/fib_types.c @@ -708,6 +708,13 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args) rpath->frp_proto = DPO_PROTO_IP4; rpath->frp_flags = FIB_ROUTE_PATH_INTF_RX; } + else if (unformat (input, "rx-ip6 %U", + unformat_vnet_sw_interface, vnm, + &rpath->frp_sw_if_index)) + { + rpath->frp_proto = DPO_PROTO_IP6; + rpath->frp_flags = FIB_ROUTE_PATH_INTF_RX; + } else if (unformat (input, "local")) { clib_memset (&rpath->frp_addr, 0, sizeof (rpath->frp_addr)); @@ -775,6 +782,7 @@ fib_route_path_is_attached (const fib_route_path_t *rpath) * L3 game with these */ if (rpath->frp_flags & (FIB_ROUTE_PATH_DVR | + FIB_ROUTE_PATH_INTF_RX | FIB_ROUTE_PATH_UDP_ENCAP)) { return (0); diff --git a/src/vnet/fib/fib_types.h b/src/vnet/fib/fib_types.h index 49a4b39d042..b9346c75108 100644 --- a/src/vnet/fib/fib_types.h +++ b/src/vnet/fib/fib_types.h @@ -633,7 +633,7 @@ extern int fib_route_path_is_attached (const fib_route_path_t *rpath); /** * A help string to list the FIB path options */ -#define FIB_ROUTE_PATH_HELP "[next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]" +#define FIB_ROUTE_PATH_HELP "[next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4|rx-ip6 <interface>] [out-labels <value value value>]" /** * return code to control pat-hlist walk diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c index 80a35fefdfc..f86c8b61289 100644 --- a/src/vnet/ip/lookup.c +++ b/src/vnet/ip/lookup.c @@ -620,7 +620,7 @@ VLIB_CLI_COMMAND (ip_route_command, static) = { "[next-hop-table <value>] [weight <value>] [preference " "<value>] [udp-encap <value>] [ip4-lookup-in-table <value>] " "[ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] " - "[resolve-via-host] [resolve-via-connected] [rx-ip4 " + "[resolve-via-host] [resolve-via-connected] [rx-ip4|rx-ip6 " "<interface>] [out-labels <value value value>]", .function = vnet_ip_route_cmd, .is_mp_safe = 1, diff --git a/src/vnet/mpls/mpls.c b/src/vnet/mpls/mpls.c index 0d01010feea..a04e1cf6985 100644 --- a/src/vnet/mpls/mpls.c +++ b/src/vnet/mpls/mpls.c @@ -370,7 +370,13 @@ done: VLIB_CLI_COMMAND (mpls_local_label_command, static) = { .path = "mpls local-label", .function = vnet_mpls_local_label, - .short_help = "mpls local-label [add|del] <label-value> [eos|non-eos] via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-attached] [rx-ip4 <interface>] [out-labels <value value value>]", + .short_help = + "mpls local-label [add|del] <label-value> [eos|non-eos] via " + "[next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight " + "<value>] [preference <value>] [udp-encap-id <value>] " + "[ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] " + "[mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-attached] " + "[rx-ip4|rx-ip6 <interface>] [out-labels <value value value>]", }; clib_error_t * diff --git a/src/vnet/mpls/mpls_tunnel.c b/src/vnet/mpls/mpls_tunnel.c index 5f7bf8c3b25..b03a4a57f68 100644 --- a/src/vnet/mpls/mpls_tunnel.c +++ b/src/vnet/mpls/mpls_tunnel.c @@ -932,7 +932,12 @@ done: VLIB_CLI_COMMAND (create_mpls_tunnel_command, static) = { .path = "mpls tunnel", .short_help = - "mpls tunnel [multicast] [l2-only] via [next-hop-address] [next-hop-interface] [next-hop-table <value>] [weight <value>] [preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table <value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] [resolve-via-host] [resolve-via-connected] [rx-ip4 <interface>] [out-labels <value value value>]", + "mpls tunnel [multicast] [l2-only] via [next-hop-address] " + "[next-hop-interface] [next-hop-table <value>] [weight <value>] " + "[preference <value>] [udp-encap-id <value>] [ip4-lookup-in-table " + "<value>] [ip6-lookup-in-table <value>] [mpls-lookup-in-table <value>] " + "[resolve-via-host] [resolve-via-connected] [rx-ip4|rx-ip6 <interface>] " + "[out-labels <value value value>]", .function = vnet_create_mpls_tunnel_command_fn, }; |