Merge pull request #371 from donaldsharp/as_path_fix_3.0

bgpd: Fix 'set as-path prepend last-as 10'
This commit is contained in:
Martin Winter 2017-04-17 14:47:08 -07:00 committed by GitHub
commit 3060be2af5
2 changed files with 3 additions and 5 deletions

View File

@ -8562,8 +8562,6 @@ static int
bgp_show_regexp (struct vty *vty, const char *regstr, afi_t afi, bgp_show_regexp (struct vty *vty, const char *regstr, afi_t afi,
safi_t safi, enum bgp_show_type type) safi_t safi, enum bgp_show_type type)
{ {
return CMD_SUCCESS;
regex_t *regex; regex_t *regex;
int rc; int rc;

View File

@ -1437,7 +1437,7 @@ route_set_aspath_prepend_compile (const char *arg)
{ {
unsigned int num; unsigned int num;
if (sscanf(arg, "last-as %u", &num) == 1 && num > 0 && num < 10) if (sscanf(arg, "last-as %u", &num) == 1 && num > 0 && num <= 10)
return (void*)(uintptr_t)num; return (void*)(uintptr_t)num;
return route_aspath_compile(arg); return route_aspath_compile(arg);
@ -3677,12 +3677,12 @@ DEFUN (set_aspath_prepend_asn,
DEFUN (set_aspath_prepend_lastas, DEFUN (set_aspath_prepend_lastas,
set_aspath_prepend_lastas_cmd, set_aspath_prepend_lastas_cmd,
"set as-path prepend last-as (1-9)", "set as-path prepend last-as (1-10)",
SET_STR SET_STR
"Transform BGP AS_PATH attribute\n" "Transform BGP AS_PATH attribute\n"
"Prepend to the as-path\n" "Prepend to the as-path\n"
"Use the peer's AS-number\n" "Use the peer's AS-number\n"
"Number of times to insert") "Number of times to insert\n")
{ {
return set_aspath_prepend_asn (self, vty, argc, argv); return set_aspath_prepend_asn (self, vty, argc, argv);
} }