From 5009160c748b19a543a2f4fbd01d9de69ca71955 Mon Sep 17 00:00:00 2001 From: Ulrich Weber Date: Wed, 16 Nov 2011 19:32:12 +0400 Subject: 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. --- bgpd/bgp_vty.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'bgpd/bgp_vty.c') diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 101f6765..9cb30182 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -4177,18 +4177,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) -- cgit v1.2.1