summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2022-09-09 17:02:31 +0200
committerNeale Ranns <neale@graphiant.com>2022-09-20 22:35:55 +0000
commited9b67429e6c8e0b37c98ba37e876565f1d8e13e (patch)
tree487aec5f609945f9f6becb70bbbff98279b924f5 /src/vnet/fib
parent6b4c6e1624ac15e20eeeac385aa8cbee0f142121 (diff)
fib: add cli support for explicit link type
This adds the ability to specify we want an IPv4 route via an IPv6 adj and vice-versa. Type: improvement Change-Id: I5f7f1ab89fc60244d31c26155bbd9b0db690257c Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/fib')
-rw-r--r--src/vnet/fib/fib_types.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c
index 15e795a72c9..7eeb79fffa5 100644
--- a/src/vnet/fib/fib_types.c
+++ b/src/vnet/fib/fib_types.c
@@ -541,6 +541,7 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
{
fib_route_path_t *rpath = va_arg (*args, fib_route_path_t *);
dpo_proto_t *payload_proto = va_arg (*args, void*);
+ dpo_proto_t explicit_proto = DPO_PROTO_NONE;
u32 weight, preference, udp_encap_id, fi;
mpls_label_t out_label;
vnet_main_t *vnm;
@@ -726,6 +727,14 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
vec_add1(rpath->frp_label_stack, fml);
}
}
+ else if (unformat (input, "ip4"))
+ {
+ explicit_proto = DPO_PROTO_IP4;
+ }
+ else if (unformat (input, "ip6"))
+ {
+ explicit_proto = DPO_PROTO_IP6;
+ }
else if (unformat (input, "%U",
unformat_vnet_sw_interface, vnm,
&rpath->frp_sw_if_index))
@@ -750,6 +759,9 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
}
}
+ if (DPO_PROTO_NONE != explicit_proto)
+ *payload_proto = rpath->frp_proto = explicit_proto;
+
return (1);
}