]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12166 from anlancs/fix/bgpd-wildcard
authorRuss White <russ@riw.us>
Tue, 25 Oct 2022 15:34:38 +0000 (11:34 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Oct 2022 15:34:38 +0000 (11:34 -0400)
bgpd: return failure for wildcard ERT

bgpd/bgp_evpn_vty.c

index 24fa2b2a539df123ee6c685fb54f0837e04fe723..c0ad72dc3389de27f9e895b48ebff539f6b135f9 100644 (file)
@@ -5866,13 +5866,6 @@ static int parse_rtlist(struct bgp *bgp, struct vty *vty, int argc,
                 * the ecommunity parser.
                 */
                if ((argv[i]->arg)[0] == '*') {
-                       if (!is_import) {
-                               vty_out(vty,
-                                       "%% Wildcard '*' only applicable for import\n");
-                               ret = CMD_WARNING;
-                               continue;
-                       }
-
                        (argv[i]->arg)[0] = '0';
                        is_wildcard = true;
                }
@@ -5950,6 +5943,16 @@ DEFUN (bgp_evpn_vrf_rt,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
+       if (rt_type != RT_TYPE_IMPORT) {
+               for (int i = 2; i < argc; i++) {
+                       if ((argv[i]->arg)[0] == '*') {
+                               vty_out(vty,
+                                       "%% Wildcard '*' only applicable for import\n");
+                               return CMD_WARNING_CONFIG_FAILED;
+                       }
+               }
+       }
+
        /* Add/update the import route-target */
        if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
                tmp_ret = parse_rtlist(bgp, vty, argc, argv, 2, true, true);
@@ -6056,6 +6059,16 @@ DEFUN (no_bgp_evpn_vrf_rt,
                }
        }
 
+       if (rt_type != RT_TYPE_IMPORT) {
+               for (int i = 3; i < argc; i++) {
+                       if ((argv[i]->arg)[0] == '*') {
+                               vty_out(vty,
+                                       "%% Wildcard '*' only applicable for import\n");
+                               return CMD_WARNING_CONFIG_FAILED;
+                       }
+               }
+       }
+
        if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
                tmp_ret = parse_rtlist(bgp, vty, argc, argv, 3, false, true);