summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_types.c
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-07-09 13:03:52 +0000
committerDamjan Marion <dmarion@me.com>2021-07-13 19:26:07 +0000
commit66edaf209fcfa618f42c0e6d21873a31de86b412 (patch)
treee7faf670a70fe98ce284e3bfe79afdb77f8c46fd /src/vnet/fib/fib_types.c
parent48057bd23433a352338358ca1f6cdc6cebd84f08 (diff)
fib: Set the GLEAN flag on attached export routes so that the SAS works
correctly. Type: fix Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I4bc2eb394a8f9d01c5a12de2ce963c22209d5439
Diffstat (limited to 'src/vnet/fib/fib_types.c')
-rw-r--r--src/vnet/fib/fib_types.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_types.c b/src/vnet/fib/fib_types.c
index e2b8df79e63..eab5ca22571 100644
--- a/src/vnet/fib/fib_types.c
+++ b/src/vnet/fib/fib_types.c
@@ -752,3 +752,36 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
return (1);
}
+
+/*
+ * Return true if the path is attached
+ */
+int
+fib_route_path_is_attached (const fib_route_path_t *rpath)
+{
+ /*
+ * DVR paths are not attached, since we are not playing the
+ * L3 game with these
+ */
+ if (rpath->frp_flags & (FIB_ROUTE_PATH_DVR |
+ FIB_ROUTE_PATH_UDP_ENCAP))
+ {
+ return (0);
+ }
+
+ /*
+ * - All zeros next-hop
+ * - a valid interface
+ */
+ if (ip46_address_is_zero(&rpath->frp_addr) &&
+ (~0 != rpath->frp_sw_if_index))
+ {
+ return (!0);
+ }
+ else if (rpath->frp_flags & FIB_ROUTE_PATH_ATTACHED ||
+ rpath->frp_flags & FIB_ROUTE_PATH_GLEAN)
+ {
+ return (!0);
+ }
+ return (0);
+}