summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_urpf_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/fib/fib_urpf_list.c')
-rw-r--r--src/vnet/fib/fib_urpf_list.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/vnet/fib/fib_urpf_list.c b/src/vnet/fib/fib_urpf_list.c
index 263812ade40..b484442026a 100644
--- a/src/vnet/fib/fib_urpf_list.c
+++ b/src/vnet/fib/fib_urpf_list.c
@@ -29,16 +29,24 @@ format_fib_urpf_list (u8 *s, va_list args)
u32 *swi;
ui = va_arg(args, index_t);
- urpf = fib_urpf_list_get(ui);
- s = format(s, "uPRF-list:%d len:%d itfs:[",
- ui, vec_len(urpf->furpf_itfs));
+ if (INDEX_INVALID != ui)
+ {
+ urpf = fib_urpf_list_get(ui);
+
+ s = format(s, "uPRF-list:%d len:%d itfs:[",
+ ui, vec_len(urpf->furpf_itfs));
- vec_foreach(swi, urpf->furpf_itfs)
+ vec_foreach(swi, urpf->furpf_itfs)
+ {
+ s = format(s, "%d, ", *swi);
+ }
+ s = format(s, "]");
+ }
+ else
{
- s = format(s, "%d, ", *swi);
+ s = format(s, "uRPF-list: None");
}
- s = format(s, "]");
return (s);
}