Skip to content

Commit 5f37d59

Browse files
authored
Merge pull request #12166 from anlancs/fix/bgpd-wildcard
bgpd: return failure for wildcard ERT
2 parents bcc6ffb + 7231b9a commit 5f37d59

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

bgpd/bgp_evpn_vty.c

+20-7
Original file line numberDiff line numberDiff line change
@@ -5866,13 +5866,6 @@ static int parse_rtlist(struct bgp *bgp, struct vty *vty, int argc,
58665866
* the ecommunity parser.
58675867
*/
58685868
if ((argv[i]->arg)[0] == '*') {
5869-
if (!is_import) {
5870-
vty_out(vty,
5871-
"%% Wildcard '*' only applicable for import\n");
5872-
ret = CMD_WARNING;
5873-
continue;
5874-
}
5875-
58765869
(argv[i]->arg)[0] = '0';
58775870
is_wildcard = true;
58785871
}
@@ -5950,6 +5943,16 @@ DEFUN (bgp_evpn_vrf_rt,
59505943
return CMD_WARNING_CONFIG_FAILED;
59515944
}
59525945

5946+
if (rt_type != RT_TYPE_IMPORT) {
5947+
for (int i = 2; i < argc; i++) {
5948+
if ((argv[i]->arg)[0] == '*') {
5949+
vty_out(vty,
5950+
"%% Wildcard '*' only applicable for import\n");
5951+
return CMD_WARNING_CONFIG_FAILED;
5952+
}
5953+
}
5954+
}
5955+
59535956
/* Add/update the import route-target */
59545957
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
59555958
tmp_ret = parse_rtlist(bgp, vty, argc, argv, 2, true, true);
@@ -6056,6 +6059,16 @@ DEFUN (no_bgp_evpn_vrf_rt,
60566059
}
60576060
}
60586061

6062+
if (rt_type != RT_TYPE_IMPORT) {
6063+
for (int i = 3; i < argc; i++) {
6064+
if ((argv[i]->arg)[0] == '*') {
6065+
vty_out(vty,
6066+
"%% Wildcard '*' only applicable for import\n");
6067+
return CMD_WARNING_CONFIG_FAILED;
6068+
}
6069+
}
6070+
}
6071+
60596072
if (rt_type == RT_TYPE_BOTH || rt_type == RT_TYPE_IMPORT)
60606073
tmp_ret = parse_rtlist(bgp, vty, argc, argv, 3, false, true);
60616074

0 commit comments

Comments
 (0)