diff options
author | Ulrich Weber <ulrich.weber@sophos.com> | 2011-11-16 19:32:12 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2011-12-13 14:25:25 +0400 |
commit | bde12e3fd5e498a266e813a5751c1b2d21e46ca5 (patch) | |
tree | 3a3a77cc2321925f3d00d192b994a4440da129a0 /bgpd | |
parent | 42a7debf3c76b8001ce820e104a29d2f693c7cb7 (diff) |
bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()
Second patch replaces "VTY_GET_LONG ("AS", as_ul, arg);"
by "VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);"
as done in all other code, which parses AS numbers.
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_vty.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 44c55f2a..439aeebe 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -4215,18 +4215,10 @@ bgp_clear (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi, if (sort == clear_as) { as_t as; - unsigned long as_ul; int find = 0; - VTY_GET_LONG ("AS", as_ul, arg); + VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX); - if (!as_ul) - { - vty_out (vty, "Invalid AS number%s", VTY_NEWLINE); - return CMD_WARNING; - } - as = (as_t) as_ul; - for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) { if (peer->as != as) |