aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/ip6_fib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib/ip6_fib.h')
-rw-r--r--src/vnet/fib/ip6_fib.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/vnet/fib/ip6_fib.h b/src/vnet/fib/ip6_fib.h
index 78da3746f17..e460e2ffd09 100644
--- a/src/vnet/fib/ip6_fib.h
+++ b/src/vnet/fib/ip6_fib.h
@@ -20,6 +20,7 @@
#include <vnet/ip/format.h>
#include <vnet/fib/fib_entry.h>
#include <vnet/fib/fib_table.h>
+#include <vnet/fib/fib_urpf_list.h>
#include <vnet/ip/lookup.h>
#include <vnet/dpo/load_balance.h>
@@ -67,7 +68,28 @@ extern void ip6_fib_table_walk(u32 fib_index,
void *ctx);
/**
- * @biref return the DPO that the LB stacks on.
+ * @brief returns number of links on which src is reachable.
+ */
+always_inline int
+ip6_urpf_loose_check (ip6_main_t * im,
+ vlib_buffer_t * b,
+ ip6_header_t * i)
+{
+ const load_balance_t *lb0;
+ index_t lbi;
+
+ lbi = ip6_fib_table_fwding_lookup_with_if_index(
+ im,
+ vnet_buffer (b)->sw_if_index[VLIB_RX],
+ &i->src_address);
+
+ lb0 = load_balance_get(lbi);
+
+ return (fib_urpf_check_size (lb0->lb_urpf));
+}
+
+/**
+ * @brief return the DPO that the LB stacks on.
*/
always_inline u32
ip6_src_lookup_for_packet (ip6_main_t * im,