* 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;
}
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);
}
}
+ 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);