aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenglei <1579628578@qq.com>2025-01-09 17:32:35 +0800
committerDave Wallace <dwallacelf@gmail.com>2025-02-05 16:51:54 +0000
commit66ae89b8e3abc9ddf94d5a8879bb4960dab983a5 (patch)
tree274bad4d5f1ef25918728e24cd0bc401ee6c242b
parentb02e93846122501b0eb6e5a43cce05fc670f8b3b (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>
-rw-r--r--src/vnet/l2/l2_input_node.c5
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;