]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()
authorUlrich Weber <ulrich.weber@sophos.com>
Wed, 16 Nov 2011 15:32:12 +0000 (19:32 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 13 Dec 2011 10:25:25 +0000 (14:25 +0400)
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

index 44c55f2ad32a54a445ff3970cb52740a3b6f7bb7..439aeebeb0f74a5871694481cdbbeb4e5fde5a82 100644 (file)
@@ -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)