diff options
author | 2025-01-09 17:32:35 +0800 | |
---|---|---|
committer | 2025-02-05 16:53:14 +0000 | |
commit | 854dd1fb26512f0cefbaaf1e5aed2f0c014f694a (patch) | |
tree | d36dee67521ec7228cc39ea7bb146f77417ac5a3 | |
parent | cd837bd2937c2c80964631519c83e989af454d2f (diff) |
l2: fix segment fault
if feature_bitmap is zero, it will make feat_bitmap_get_next_node_index function generate segment fault
Type: fix
Change-Id: I6a9c0b29d927e600537e9e43ad696d09c091f9b1
Signed-off-by: fenglei <1579628578@qq.com>
(cherry picked from commit 03c21e0700ba59ca4bb8e81bdb18779f35a1845a)
-rw-r--r-- | src/vnet/l2/l2_input_node.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/l2/l2_input_node.c b/src/vnet/l2/l2_input_node.c index 76b94809eb3..58a541756da 100644 --- a/src/vnet/l2/l2_input_node.c +++ b/src/vnet/l2/l2_input_node.c @@ -215,7 +215,10 @@ classify_and_dispatch (l2input_main_t * msm, vlib_buffer_t * b0, u16 * next0) vnet_buffer (b0)->sw_if_index[VLIB_TX] = config->output_sw_if_index; } else - feat_mask = L2INPUT_FEAT_DROP; + { + *next0 = L2INPUT_NEXT_DROP; + return; + } /* mask out features from bitmap using packet type and bd config */ u32 feature_bitmap = config->feature_bitmap & feat_mask; |