]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix segfault when re-adding "match evpn default-route" rule
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 13:55:17 +0000 (13:55 +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 9dc1c7c82d92fd58673d1ef42d13b89b064aaec1..34166c180d90d9c70bf79b697cc6cb2572ea785e 100644 (file)
@@ -1325,7 +1325,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);