From b3c6fd64a4bd84668337eee7cf37768d22744168 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 12 Aug 2021 19:07:53 +0300 Subject: [PATCH] bgpd: fix segfault when re-adding "match evpn default-route" rule When using "match evpn default-route" rule, match_arg is NULL and strcmp is not happy with that. There's already a special function named rulecmp that handles such situations. Signed-off-by: Igor Ryzhov (cherry picked from commit 30475121ad590f8e44ebb2601776ae94df976069) --- lib/routemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routemap.c b/lib/routemap.c index 3ba5c3204c..0744437bb6 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1319,7 +1319,7 @@ enum rmap_compile_rets route_map_add_match(struct route_map_index *index, * the same as the existing configuration then, * ignore the duplicate configuration. */ - if (strcmp(match_arg, rule->rule_str) == 0) { + if (rulecmp(match_arg, rule->rule_str) == 0) { if (cmd->func_free) (*cmd->func_free)(compile); -- 2.39.5