]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix segfault when re-adding "match evpn default-route" rule 9428/head
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 12 Aug 2021 16:07:53 +0000 (19:07 +0300)
committermergify-bot <noreply@mergify.io>
Tue, 17 Aug 2021 15:27:33 +0000 (15:27 +0000)
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 <iryzhov@nfware.com>
(cherry picked from commit 30475121ad590f8e44ebb2601776ae94df976069)

lib/routemap.c

index 3ba5c3204c100eb6a6b17260458861673e1d00b2..0744437bb66ba1cf6f5f474fc8b45979449f57d3 100644 (file)
@@ -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);