diff options
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r-- | bgpd/bgp_routemap.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 806a5072..a0f8eff4 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -1636,7 +1636,7 @@ route_set_aggregator_as_compile (const char *arg) sscanf (arg, "%s %s", as, address); - aggregator->as = strtoul (as, NULL, 10); + aggregator->as = str2asnum (as, NULL); inet_aton (address, &aggregator->address); return aggregator; @@ -3234,7 +3234,7 @@ DEFUN (no_set_atomic_aggregate, DEFUN (set_aggregator_as, set_aggregator_as_cmd, - "set aggregator as <1-65535> A.B.C.D", + "set aggregator as ASNUMBER A.B.C.D", SET_STR "BGP aggregator attribute\n" "AS number of aggregator\n" @@ -3246,7 +3246,14 @@ DEFUN (set_aggregator_as, struct in_addr address; char *argstr; - VTY_GET_INTEGER_RANGE ("AS Path", as, argv[0], 1, BGP_AS_MAX); + as = str2asnum( argv[0], NULL ); + if ( !as ) + { + vty_out (vty, "%s is not a valid as number.%s", + argv[0], + VTY_NEWLINE); + return CMD_WARNING; + } ret = inet_aton (argv[1], &address); if (ret == 0) @@ -3283,7 +3290,13 @@ DEFUN (no_set_aggregator_as, if (argv == 0) return bgp_route_set_delete (vty, vty->index, "aggregator as", NULL); - VTY_GET_INTEGER_RANGE ("AS Path", as, argv[0], 1, BGP_AS_MAX); + as = str2asnum( argv[0], NULL ); + if ( !as ) { + vty_out (vty, "%s is not a valid as number.%s", + argv[0], + VTY_NEWLINE); + return CMD_WARNING; + } ret = inet_aton (argv[1], &address); if (ret == 0) @@ -3306,7 +3319,7 @@ DEFUN (no_set_aggregator_as, ALIAS (no_set_aggregator_as, no_set_aggregator_as_val_cmd, - "no set aggregator as <1-65535> A.B.C.D", + "no set aggregator as ASNUMBER A.B.C.D", NO_STR SET_STR "BGP aggregator attribute\n" |