]> git.puffer.fish Git - mirror/frr.git/commitdiff
all: scrubbed some argc CHECK MEs
authorDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 30 Sep 2016 00:16:31 +0000 (00:16 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 30 Sep 2016 00:16:31 +0000 (00:16 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
16 files changed:
bgpd/bgp_filter.c
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
lib/command.c
lib/filter.c
lib/grammar_sandbox.c
lib/if.c
lib/plist.c
lib/routemap.c
lib/vty.c
ospfd/ospf_dump.c
ospfd/ospf_ri.c
ospfd/ospf_routemap.c
pimd/pim_cmd.c
zebra/rtadv.c
zebra/zebra_vty.c

index 255f6c2b6ae996a6da375c617e0864601b50f4eb..cee68e4d4ced990c514fe40c0e3e06e31d403b25 100644 (file)
@@ -437,7 +437,6 @@ DEFUN (ip_as_path,
        "Specify packets to forward\n"
        "A regular-expression to match the BGP AS paths\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 3;
   int idx_permit_deny = 4;
   enum as_filter_type type;
@@ -458,7 +457,7 @@ DEFUN (ip_as_path,
     }
 
   /* Check AS path regex. */
-  regstr = argv_concat(argv, argc, 2);
+  regstr = argv_concat(argv, argc, idx_permit_deny);
 
   regex = bgp_regcomp (regstr);
   if (!regex)
@@ -497,7 +496,6 @@ DEFUN (no_ip_as_path,
        "Specify packets to forward\n"
        "A regular-expression to match the BGP AS paths\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 4;
   int idx_permit_deny = 5;
   enum as_filter_type type;
@@ -527,7 +525,7 @@ DEFUN (no_ip_as_path,
     }
   
   /* Compile AS path. */
-  regstr = argv_concat(argv, argc, 2);
+  regstr = argv_concat(argv, argc, idx_permit_deny);
 
   regex = bgp_regcomp (regstr);
   if (!regex)
index 3ddfef4be19f9430f11259cbf8a24f35895f48f4..d57d5886678644583887d51a7a6ff406d18b2623 100644 (file)
@@ -3719,11 +3719,11 @@ DEFUN (set_aspath_prepend,
        "Use the peer's AS-number\n"
        "Number of times to insert")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 3;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn);
   ret = bgp_route_set_add (vty, vty->index, "as-path prepend", str);
   XFREE (MTYPE_TMP, str);
 
@@ -3740,11 +3740,11 @@ DEFUN (no_set_aspath_prepend,
        "Prepend to the as-path\n"
        "AS number\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 4;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn);
   ret = bgp_route_set_delete (vty, vty->index, "as-path prepend", str);
   XFREE (MTYPE_TMP, str);
   return ret;
@@ -3759,11 +3759,11 @@ DEFUN (set_aspath_exclude,
        "Exclude from the as-path\n"
        "AS number\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 3;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn);
   ret = bgp_route_set_add (vty, vty->index, "as-path exclude", str);
   XFREE (MTYPE_TMP, str);
   return ret;
@@ -3778,11 +3778,11 @@ DEFUN (no_set_aspath_exclude,
        "Exclude from the as-path\n"
        "AS number\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 4;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn);
   ret = bgp_route_set_delete (vty, vty->index, "as-path exclude", str);
   XFREE (MTYPE_TMP, str);
   return ret;
@@ -3796,7 +3796,7 @@ DEFUN (set_community,
        "BGP community attribute\n"
        COMMUNITY_VAL_STR)
 {
-  /* CHECK ME argc referenced below */
+  int idx_aa_nn = 2;
   int i;
   int first = 0;
   int additive = 0;
@@ -3808,7 +3808,7 @@ DEFUN (set_community,
 
   b = buffer_new (1024);
 
-  for (i = 0; i < argc; i++)
+  for (i = idx_aa_nn; i < argc; i++)
     {
       if (strncmp (argv[i]->arg, "additive", strlen (argv[i]->arg)) == 0)
        {
@@ -3947,11 +3947,11 @@ DEFUN (set_ecommunity_rt,
        "Route Target extended community\n"
        "VPN extended community\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn_nn = 3;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn_nn);
   ret = bgp_route_set_add (vty, vty->index, "extcommunity rt", str);
   XFREE (MTYPE_TMP, str);
 
@@ -3978,11 +3978,11 @@ DEFUN (set_ecommunity_soo,
        "Site-of-Origin extended community\n"
        "VPN extended community\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn_nn = 3;
   int ret;
   char *str;
 
-  str = argv_concat (argv, argc, 0);
+  str = argv_concat (argv, argc, idx_asn_nn);
   ret = bgp_route_set_add (vty, vty->index, "extcommunity soo", str);
   XFREE (MTYPE_TMP, str);
   return ret;
index 4e4571a01a38327036615221c2045a000ff5bfa0..0ced86023dd746359e8d358eede46c2585fd6e39 100644 (file)
@@ -949,14 +949,14 @@ DEFUN (bgp_confederation_peers,
        "Peer ASs in BGP confederation\n"
        AS_STR)
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 3;
   struct bgp *bgp;
   as_t as;
   int i;
 
   bgp = vty->index;
 
-  for (i = 0; i < argc; i++)
+  for (i = idx_asn; i < argc; i++)
     {
       VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
 
@@ -981,14 +981,14 @@ DEFUN (no_bgp_confederation_peers,
        "Peer ASs in BGP confederation\n"
        AS_STR)
 {
-  /* CHECK ME argc referenced below */
+  int idx_asn = 4;
   struct bgp *bgp;
   as_t as;
   int i;
 
   bgp = vty->index;
 
-  for (i = 0; i < argc; i++)
+  for (i = idx_asn; i < argc; i++)
     {
       VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
 
@@ -4329,8 +4329,8 @@ DEFUN (neighbor_description,
        "Neighbor specific description\n"
        "Up to 80 characters describing this neighbor\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_peer = 1;
+  int idx_line = 3;
   struct peer *peer;
   char *str;
 
@@ -4338,10 +4338,7 @@ DEFUN (neighbor_description,
   if (! peer)
     return CMD_WARNING;
 
-  if (argc == 1)
-    return CMD_SUCCESS;
-
-  str = argv_concat(argv, argc, 1);
+  str = argv_concat(argv, argc, idx_line);
 
   peer_description_set (peer, str);
 
index 4be178e12275410137661964a72735d530525a83..95d69cdbf66b9dfc0d5bf8e1b630af22726bb53b 100644 (file)
@@ -1016,7 +1016,6 @@ DEFUN (config_quit,
        "quit",
        "Exit current mode and down to previous mode\n")
 {
-  /* CHECK ME argc referenced below */
   return config_exit (self, vty, argc, argv);
 }
 
@@ -1138,7 +1137,6 @@ DEFUN (config_write,
        "Write configuration currently in memory\n"
        "Write configuration to terminal\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_type = 1;
   unsigned int i;
   int fd;
@@ -1284,7 +1282,6 @@ DEFUN (show_running_config,
        SHOW_STR
        "running configuration (same as write terminal/memory)\n")
 {
-  /* CHECK ME argc referenced below */
   return config_write (self, vty, argc, argv);
 }
 
@@ -1296,7 +1293,6 @@ DEFUN (copy_runningconf_startupconf,
        "Copy running config to... \n"
        "Copy running config to startup config (same as write file)\n")
 {
-  /* CHECK ME argc referenced below */
   return config_write (self, vty, argc, argv);
 }
 /** -- **/
@@ -1378,7 +1374,6 @@ DEFUN (config_password,
        "Specifies a HIDDEN password will follow\n"
        "The password string\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_8 = 1;
   int idx_word = 2;
   if (argc == 3) // '8' was specified
@@ -1425,9 +1420,9 @@ DEFUN (config_enable_password,
        "dummy string \n"
        "The HIDDEN 'enable' password string\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_8 = 2;
   int idx_word = 3;
+
   /* Crypt type is specified. */
   if (argc == 4)
     {
@@ -1618,7 +1613,7 @@ DEFUN_HIDDEN (do_echo,
 {
   char *message;
 
-  vty_out (vty, "%s%s", ((message = argv_concat (argv, argc, 0)) ? message : ""),
+  vty_out (vty, "%s%s", ((message = argv_concat (argv, argc, 1)) ? message : ""),
            VTY_NEWLINE);
   if (message)
     XFREE(MTYPE_TMP, message);
@@ -1632,15 +1627,15 @@ DEFUN (config_logmsg,
        LOG_LEVEL_DESC
        "The message to send\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_log_level = 1;
+  int idx_message = 2;
   int level;
   char *message;
 
   if ((level = level_match(argv[idx_log_level]->arg)) == ZLOG_DISABLED)
     return CMD_ERR_NO_MATCH;
 
-  zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, 1)) ? message : ""));
+  zlog(NULL, level, "%s", ((message = argv_concat(argv, argc, idx_message)) ? message : ""));
   if (message)
     XFREE(MTYPE_TMP, message);
   return CMD_SUCCESS;
@@ -1706,9 +1701,9 @@ DEFUN (config_log_stdout,
        "Set stdout logging level\n"
        LOG_LEVEL_DESC)
 {
-  /* CHECK ME argc referenced below */
   int idx_log_level = 2;
-  if (argc == 2)
+
+  if (argc == idx_log_level)
   {
     zlog_set_level (NULL, ZLOG_DEST_STDOUT, zlog_default->default_lvl);
     return CMD_SUCCESS;
@@ -1740,9 +1735,9 @@ DEFUN (config_log_monitor,
        "Set terminal line (monitor) logging level\n"
        LOG_LEVEL_DESC)
 {
-  /* CHECK ME argc referenced below */
   int idx_log_level = 2;
-  if (argc == 2)
+
+  if (argc == idx_log_level)
   {
     zlog_set_level (NULL, ZLOG_DEST_MONITOR, zlog_default->default_lvl);
     return CMD_SUCCESS;
@@ -1829,7 +1824,6 @@ DEFUN (config_log_file,
        "Logging filename\n"
        LOG_LEVEL_DESC)
 {
-  /* CHECK ME argc referenced below */
   int idx_filename = 2;
   int idx_log_levels = 3;
   if (argc == 4)
@@ -1870,7 +1864,6 @@ DEFUN (config_log_syslog,
        "Set syslog logging level\n"
        LOG_LEVEL_DESC)
 {
-  /* CHECK ME argc referenced below */
   int idx_log_levels = 2;
   if (argc == 3)
   {
index fd80b2a6373a5e4eb43cc9fc827c7636d84760f8..501b28f2da6f54cd2c12844c10e338579fd96e32 100644 (file)
@@ -1480,8 +1480,8 @@ DEFUN (access_list_remark,
        "Access list entry comment\n"
        "Comment up to 100 characters\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_acl = 1;
+  int idx_remark = 3;
   struct access_list *access;
 
   access = access_list_get (AFI_IP, argv[idx_acl]->arg);
@@ -1491,7 +1491,7 @@ DEFUN (access_list_remark,
       XFREE (MTYPE_TMP, access->remark);
       access->remark = NULL;
     }
-  access->remark = argv_concat(argv, argc, 1);
+  access->remark = argv_concat(argv, argc, idx_remark);
 
   return CMD_SUCCESS;
 }
@@ -1526,7 +1526,6 @@ DEFUN (no_access_list_remark_comment,
        "Access list entry comment\n"
        "Comment up to 100 characters\n")
 {
-  /* CHECK ME argc referenced below */
   return no_access_list_remark (self, vty, argc, argv);
 }
        
@@ -1675,8 +1674,8 @@ DEFUN (ipv6_access_list_remark,
        "Access list entry comment\n"
        "Comment up to 100 characters\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 2;
+  int idx_line = 4;
   struct access_list *access;
 
   access = access_list_get (AFI_IP6, argv[idx_word]->arg);
@@ -1686,7 +1685,7 @@ DEFUN (ipv6_access_list_remark,
       XFREE (MTYPE_TMP, access->remark);
       access->remark = NULL;
     }
-  access->remark = argv_concat(argv, argc, 1);
+  access->remark = argv_concat(argv, argc, idx_line);
 
   return CMD_SUCCESS;
 }
@@ -1715,7 +1714,6 @@ DEFUN (no_ipv6_access_list_remark_comment,
        "Access list entry comment\n"
        "Comment up to 100 characters\n")
 {
-  /* CHECK ME argc referenced below */
   return no_ipv6_access_list_remark (self, vty, argc, argv);
 }
        
index 34e0b81064198e6e21e7564ce688600c3d9e82ec..c4ae2d7d770480971e2ddd6511b066962e6baa67 100644 (file)
@@ -57,9 +57,9 @@ DEFUN (grammar_test,
        GRAMMAR_STR
        "command to pass to new parser\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_command = 2;
   // make a string from tokenized command line
-  char *command = argv_concat (argv, argc, 0);
+  char *command = argv_concat (argv, argc, idx_command);
 
   // create cmd_element for parser
   struct cmd_element *cmd = XCALLOC (MTYPE_CMD_TOKENS, sizeof (struct cmd_element));
@@ -81,8 +81,8 @@ DEFUN (grammar_test_complete,
        "attempt to complete input on DFA\n"
        "command to complete")
 {
-  /* CHECK ME argc referenced below */
-  char *cmdstr = argv_concat (argv, argc, 0);
+  int idx_command = 2;
+  char *cmdstr = argv_concat (argv, argc, idx_command);
   vector command = cmd_make_strvec (cmdstr);
 
   // generate completions of user input
@@ -131,11 +131,11 @@ DEFUN (grammar_test_match,
        "attempt to match input on DFA\n"
        "command to match")
 {
-  /* CHECK ME argc referenced below */
+  int idx_command = 2;
   if (argv[0][0] == '#')
     return CMD_SUCCESS;
 
-  char *cmdstr = argv_concat(argv, argc, 0);
+  char *cmdstr = argv_concat(argv, argc, idx_command);
   vector command = cmd_make_strvec (cmdstr);
 
   struct list *argvv = NULL;
index 382e69d61c993f90c35b757f318426c0f84bf111..dd8922ee91c5417b18f0d73bdfde71c827cc6c42 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -677,16 +677,13 @@ DEFUN (interface_desc,
        "Interface specific description\n"
        "Characters describing this interface\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_line = 1;
   struct interface *ifp;
 
-  if (argc == 1)
-    return CMD_SUCCESS;
-
   ifp = vty->index;
   if (ifp->desc)
     XFREE (MTYPE_TMP, ifp->desc);
-  ifp->desc = argv_concat(argv, argc, 1);
+  ifp->desc = argv_concat(argv, argc, idx_line);
 
   return CMD_SUCCESS;
 }
@@ -910,7 +907,7 @@ DEFUN (show_address,
   vrf_id_t vrf_id = VRF_DEFAULT;
 
   if (argc > 2)
-    VRF_GET_ID (vrf_id, argv[idx_vrf_cmd_str]->arg);
+    VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
 
   for (ALL_LIST_ELEMENTS_RO (vrf_iflist (vrf_id), node, ifp))
     {
index 4170230d822c17ef72b79c8f6dc78aa3aa3c47ee..23d580bd6579b85c6e29dfa124f086fc550f4e27 100644 (file)
@@ -1905,8 +1905,8 @@ DEFUN (ip_prefix_list_description,
        "Prefix-list specific description\n"
        "Up to 80 characters describing this prefix-list\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 2;
+  int idx_line = 4;
   struct prefix_list *plist;
 
   plist = prefix_list_get (AFI_IP, 0, argv[idx_word]->arg);
@@ -1916,7 +1916,7 @@ DEFUN (ip_prefix_list_description,
       XFREE (MTYPE_TMP, plist->desc);
       plist->desc = NULL;
     }
-  plist->desc = argv_concat(argv, argc, 1);
+  plist->desc = argv_concat(argv, argc, idx_line);
 
   return CMD_SUCCESS;
 }
@@ -1945,7 +1945,6 @@ DEFUN (no_ip_prefix_list_description_comment,
        "Prefix-list specific description\n"
        "Up to 80 characters describing this prefix-list\n")
 {
-  /* CHECK ME argc referenced below */
   return no_ip_prefix_list_description (self, vty, argc, argv);
 }
 
@@ -2618,8 +2617,8 @@ DEFUN (ipv6_prefix_list_description,
        "Prefix-list specific description\n"
        "Up to 80 characters describing this prefix-list\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_word = 2;
+  int iddx_line = 4;
   struct prefix_list *plist;
 
   plist = prefix_list_get (AFI_IP6, 0, argv[idx_word]->arg);
@@ -2629,7 +2628,7 @@ DEFUN (ipv6_prefix_list_description,
       XFREE (MTYPE_TMP, plist->desc);
       plist->desc = NULL;
     }
-  plist->desc = argv_concat(argv, argc, 1);
+  plist->desc = argv_concat(argv, argc, iddx_line);
 
   return CMD_SUCCESS;
 }
@@ -2658,7 +2657,6 @@ DEFUN (no_ipv6_prefix_list_description_comment,
        "Prefix-list specific description\n"
        "Up to 80 characters describing this prefix-list\n")
 {
-  /* CHECK ME argc referenced below */
   return no_ipv6_prefix_list_description_comment (self, vty, argc, argv);
 }
 
index b3d349d2f85341ba60c528b2bebeefb8691d2c0d..2e8637bcbed6bc2de9d48674758dfc988753170d 100644 (file)
@@ -1606,7 +1606,6 @@ DEFUN (rmap_continue,
        "Continue on a different entry within the route-map\n"
        "Route-map entry sequence number\n")
 {
-  /* CHECK ME argc referenced below */
   return rmap_onmatch_goto (self, vty, argc, argv);
 }
 
@@ -1618,7 +1617,6 @@ DEFUN (no_rmap_continue,
        "Continue on a different entry within the route-map\n"
        "Route-map entry sequence number\n")
 {
-  /* CHECK ME argc referenced below */
   return no_rmap_onmatch_goto (self, vty, argc, argv);
 }
 
@@ -1693,7 +1691,7 @@ DEFUN (rmap_description,
        "Route-map comment\n"
        "Comment describing this route-map rule\n")
 {
-  /* CHECK ME argc referenced below */
+  int idx_line = 1;
   struct route_map_index *index;
 
   index = vty->index;
@@ -1701,7 +1699,7 @@ DEFUN (rmap_description,
     {
       if (index->description)
        XFREE (MTYPE_TMP, index->description);
-      index->description = argv_concat (argv, argc, 1);
+      index->description = argv_concat (argv, argc, idx_line);
     }
   return CMD_SUCCESS;
 }
index 301af667e1e32cc20d7d45a008df04d77a5d74c3..5a4f0fcbe729eb5e44dab75ce3c178dcae708f01 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2948,7 +2948,6 @@ DEFUN (no_terminal_monitor,
        "Set terminal line parameters\n"
        "Copy debug output to the current terminal line\n")
 {
-  /* CHECK ME argc referenced below */
   return terminal_no_monitor (self, vty, argc, argv);
 }
 
index c55ce1de8c47b9b205bc36c8a8be076035385469..08afb75d2c9fea4d9d001220160c8a2929e4ca6a 100644 (file)
@@ -772,7 +772,6 @@ DEFUN (debug_ospf_packet,
        "Detail Information\n"
        "Detail Information\n")
 {
-  /* CHECK ME argc referenced below */
   int inst = (argv[2]->type == RANGE_TKN) ? 1 : 0;
   int detail = strmatch (argv[argc - 1]->text, "detail");
   int send = strmatch (argv[argc - (1+detail)]->text, "send");
@@ -850,7 +849,6 @@ DEFUN (no_debug_ospf_packet,
        "Detail Information\n"
        "Detail Information\n")
 {
-  /* CHECK ME argc referenced below */
   int inst = (argv[3]->type == RANGE_TKN) ? 1 : 0;
   int detail = strmatch (argv[argc - 1]->text, "detail");
   int send = strmatch (argv[argc - (1+detail)]->text, "send");
@@ -926,7 +924,6 @@ DEFUN (debug_ospf_ism,
        "ISM Event Information\n"
        "ISM TImer Information\n")
 {
-  /* CHECK ME argc referenced below */
   int inst = (argv[2]->type == RANGE_TKN);
   char *dbgparam = (argc == 4 + inst) ? argv[argc - 1]->text : NULL;
 
@@ -980,7 +977,6 @@ DEFUN (no_debug_ospf_ism,
        "ISM Event Information\n"
        "ISM TImer Information\n")
 {
-  /* CHECK ME argc referenced below */
   int inst = (argv[3]->type == RANGE_TKN);
   char *dbgparam = (argc == 5 + inst) ? argv[argc - 1]->text : NULL;
 
index 463671f7dba4a1b223992ef64595c37a961c5d64..bcb1cd8e20a864b0655b574c2da402ec0abe2236 100644 (file)
@@ -1182,7 +1182,6 @@ DEFUN (router_info,
        "Enable the Router Information functionality with Area flooding scope\n"
        "OSPF area ID in IP format")
 {
-  /* CHECK ME argc referenced below */
   int idx_ipv4 = 2;
   char *area = (argc == 3) ? argv[idx_ipv4]->arg : NULL;
 
index 1cb29f3ef42cd26724bac00011373b239512a8f9..33ddc67fccb4454a2758797470f2cf2aa2b6fd5b 100644 (file)
@@ -715,7 +715,6 @@ DEFUN (no_match_ip_nexthop,
        "IP access-list number (expanded range)\n"
        "IP access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *al = (argc == 5) ? argv[4]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "ip next-hop", al);
 }
@@ -745,7 +744,6 @@ DEFUN (no_match_ip_next_hop_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *pl = (argc == 6) ? argv[5]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "ip next-hop prefix-list", pl);
 }
@@ -776,7 +774,6 @@ DEFUN (no_match_ip_address,
        "IP access-list number (expanded range)\n"
        "IP access-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *al = (argc == 5) ? argv[4]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "ip address", al);
 }
@@ -805,7 +802,6 @@ DEFUN (no_match_ip_address_prefix_list,
        "Match entries of prefix-lists\n"
        "IP prefix-list name\n")
 {
-  /* CHECK ME argc referenced below */
   char *pl = (argc == 6) ? argv[5]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "ip address prefix-list", pl);
 }
@@ -829,7 +825,6 @@ DEFUN (no_match_interface,
        "Match first hop interface of route\n"
        "Interface name\n")
 {
-  /* CHECK ME argc referenced below */
   char *iface = (argc == 4) ? argv[3]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "interface", iface);
 }
@@ -853,7 +848,6 @@ DEFUN (no_match_tag,
        "Match tag of route\n"
        "Tag value\n")
 {
-  /* CHECK ME argc referenced below */
   char *tag = (argc == 4) ? argv[3]->arg : NULL;
   return ospf_route_match_delete (vty, vty->index, "tag", tag);
 }
@@ -877,7 +871,6 @@ DEFUN (no_set_metric,
        "Metric value for destination routing protocol\n"
        "Metric value\n")
 {
-  /* CHECK ME argc referenced below */
   char *mval = (argc == 4) ? argv[3]->arg : NULL;
   return ospf_route_set_delete (vty, vty->index, "metric", mval);
 }
@@ -903,7 +896,6 @@ DEFUN (no_set_metric_type,
        "OSPF[6] external type 1 metric\n"
        "OSPF[6] external type 2 metric\n")
 {
-  /* CHECK ME argc referenced below */
   char *ext = (argc == 4) ? argv[3]->text : NULL;
   return ospf_route_set_delete (vty, vty->index, "metric-type", ext);
 }
@@ -927,7 +919,6 @@ DEFUN (no_set_tag,
        "Tag value for routing protocol\n"
        "Tag value\n")
 {
-  /* CHECK ME argc referenced below */
   char *tag = (argc == 4) ? argv[3]->arg : NULL;
   return ospf_route_set_delete (vty, vty->index, "tag", tag);
 }
index 5f2dcefdc8f5340e0cfb627a580dc4912458f534..8cc5cf95db198a39cee08156c52d619f2a7f9fcc 100644 (file)
@@ -4052,10 +4052,10 @@ DEFUN (test_igmp_receive_report,
        "Record type\n"
        "Sources\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_number = 4;
   int idx_ipv4 = 5;
   int idx_number_2 = 6;
+  int idx_line = 7;
   char              buf[1000];
   char             *igmp_msg;
   struct ip        *ip_hdr;
@@ -4121,7 +4121,7 @@ DEFUN (test_igmp_receive_report,
   /* Scan LINE sources */
   sources = (struct in_addr *) (group_record + IGMP_V3_GROUP_RECORD_SOURCE_OFFSET);
   src_addr = sources;
-  for (argi = 3; argi < argc; ++argi,++src_addr) {
+  for (argi = idx_line; argi < argc; ++argi,++src_addr) {
     src_str = argv[argi]->arg;
     result = inet_pton(AF_INET, src_str, src_addr);
     if (result <= 0) {
@@ -4168,9 +4168,9 @@ DEFUN (test_pim_receive_dump,
        "Neighbor address\n"
        "Packet dump\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_interface = 4;
   int idx_ipv4 = 5;
+  int idx_line = 6;
   uint8_t           buf[1000];
   uint8_t          *pim_msg;
   struct ip        *ip_hdr;
@@ -4219,7 +4219,7 @@ DEFUN (test_pim_receive_dump,
   pim_msg_size = 0;
 
   /* Scan LINE dump into buffer */
-  for (argi = 2; argi < argc; ++argi) {
+  for (argi = idx_line; argi < argc; ++argi) {
     const char *str = argv[argi]->arg;
     int str_len = strlen(str);
     int str_last = str_len - 1;
@@ -4289,7 +4289,6 @@ DEFUN (test_pim_receive_hello,
        "Neighbor LAN prune delay T-bit\n"
        "Neighbor secondary addresses\n")
 {
-  /* CHECK ME argc referenced below */
   int idx_interface = 4;
   int idx_ipv4 = 5;
   int idx_number = 6;
@@ -4298,6 +4297,7 @@ DEFUN (test_pim_receive_hello,
   int idx_number_4 = 9;
   int idx_number_5 = 10;
   int idx_number_6 = 11;
+  int idx_line = 12;
   uint8_t           buf[1000];
   uint8_t          *pim_msg;
   struct ip        *ip_hdr;
@@ -4359,7 +4359,7 @@ DEFUN (test_pim_receive_hello,
   pim_msg = buf + ip_hlen;
 
   /* Scan LINE addresses */
-  for (argi = 8; argi < argc; ++argi) {
+  for (argi = idx_line; argi < argc; ++argi) {
     const char *sec_str = argv[argi]->arg;
     struct in_addr sec_addr;
     result = inet_pton(AF_INET, sec_str, &sec_addr);
index 277cf4f06fcb2e8087c6995a9b558894c08dde9d..7edba559537122d2e80f1a4e9529e093dc5a28b8 100644 (file)
@@ -1342,7 +1342,6 @@ DEFUN (ipv6_nd_prefix,
        "Do not use prefix for autoconfiguration\n"
        "Do not use prefix for onlink determination\n")
 {
-  /* CHECK ME argc referenced below */
   /* prelude */
   char *prefix = argv[3]->arg;
   int lifetimes = (argc > 4) && (argv[4]->type == RANGE_TKN || strmatch (argv[4]->text, "infinite"));
index 02b68201ec1ba0bdfe73fca97cf4713bcac767f7..e6e7f5d2eac2f42538a02d2a85a9c6351a885722 100644 (file)
@@ -1235,7 +1235,6 @@ DEFUN (show_ip_route_vrf,
        VRF_CMD_HELP_STR)
 {
   int idx_vrf = 4;
-  int idx_json = 5;
   u_char uj = use_json(argc, argv);
 
   return do_show_ip_route (vty, argv[idx_vrf]->arg, SAFI_UNICAST, uj);
@@ -2753,7 +2752,6 @@ DEFUN (show_ipv6_route,
        VRF_CMD_HELP_STR
        "Output JSON\n")
 {
-  /* CHECK ME argc referenced below */
   struct route_table *table;
   struct route_node *rn;
   struct rib *rib;
@@ -2954,7 +2952,6 @@ DEFUN (show_ipv6_route_protocol,
        VRF_CMD_HELP_STR
        QUAGGA_IP6_REDIST_HELP_STR_ZEBRA)
 {
-  /* CHECK ME argc referenced below */
   int type;
   struct route_table *table;
   struct route_node *rn;
@@ -3699,7 +3696,6 @@ DEFUN (ip_zebra_import_table_distance,
        "route-map for filtering\n"
        "route-map name\n")
 {
-  /* CHECK ME argc referenced below */
   u_int32_t table_id = 0;
 
   VTY_GET_INTEGER("table", table_id, argv[2]->arg);