aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-07-18 13:25:19 +0300
committerJohn Lo <loj@cisco.com>2017-07-20 00:24:21 +0000
commitb12ac56c44f4f6d4d5e3bc37bba39b19bc6b2551 (patch)
tree482e2d8487804a78022b7cf6d7d6678e957ebbca /src/vnet
parent908a5ea6e247b4a15f0ec7e8ee8ebff799abdc4f (diff)
L2FWD:move vec_validate out of access function
Change-Id: Id9737b6aa2b6fe3032f4627dfdbd2ea728cc3fb1 Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/l2/l2_fib.h9
-rw-r--r--src/vnet/l2/l2_input.c2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/vnet/l2/l2_fib.h b/src/vnet/l2/l2_fib.h
index 21dcc4513e0..ee6f0dc56a4 100644
--- a/src/vnet/l2/l2_fib.h
+++ b/src/vnet/l2/l2_fib.h
@@ -383,10 +383,17 @@ static_always_inline u8 *
l2fib_swif_seq_num (u32 sw_if_index)
{
l2fib_main_t *mp = &l2fib_main;
- vec_validate (mp->swif_seq_num, sw_if_index);
return vec_elt_at_index (mp->swif_seq_num, sw_if_index);
}
+static_always_inline u8 *
+l2fib_valid_swif_seq_num (u32 sw_if_index)
+{
+ l2fib_main_t *mp = &l2fib_main;
+ vec_validate (mp->swif_seq_num, sw_if_index);
+ return l2fib_swif_seq_num (sw_if_index);
+}
+
BVT (clib_bihash) * get_mac_table (void);
#endif
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index 9a3148c533a..aa15621320e 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -618,7 +618,7 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */
config->xconnect = 0;
config->bridge = 1;
config->bd_index = bd_index;
- *l2fib_swif_seq_num (sw_if_index) += 1;
+ *l2fib_valid_swif_seq_num (sw_if_index) += 1;
/*
* Enable forwarding, flooding, learning and ARP termination by default