summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-05-13 13:35:57 +0200
committerGitHub <noreply@github.com>2022-05-13 13:35:57 +0200
commit69df174216b5829d3075765e0dba30d16f20e25c (patch)
tree0941a78075e61004c563f5f775aa4d739d2587d3 /bgpd/bgp_vty.c
parentMerge pull request #9454 from anlancs/fix-ospf6-gr-length (diff)
parentbgpd: Check and validate return value for str2ipaddr() (diff)
downloadfrr-69df174216b5829d3075765e0dba30d16f20e25c.tar.xz
frr-69df174216b5829d3075765e0dba30d16f20e25c.zip
Merge pull request #11188 from opensourcerouting/fix/argv_find
bgpd: Cleanup
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index ff28bf641..4a3688be2 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -1974,8 +1974,8 @@ DEFUN (bgp_maxmed_onstartup,
VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx = 0;
- argv_find(argv, argc, "(5-86400)", &idx);
- bgp->v_maxmed_onstartup = strtoul(argv[idx]->arg, NULL, 10);
+ if (argv_find(argv, argc, "(5-86400)", &idx))
+ bgp->v_maxmed_onstartup = strtoul(argv[idx]->arg, NULL, 10);
if (argv_find(argv, argc, "(0-4294967295)", &idx))
bgp->maxmed_onstartup_value = strtoul(argv[idx]->arg, NULL, 10);
else
@@ -2275,9 +2275,12 @@ DEFUN (bgp_coalesce_time,
VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx = 0;
- argv_find(argv, argc, "(0-4294967295)", &idx);
+
bgp->heuristic_coalesce = false;
- bgp->coalesce_time = strtoul(argv[idx]->arg, NULL, 10);
+
+ if (argv_find(argv, argc, "(0-4294967295)", &idx))
+ bgp->coalesce_time = strtoul(argv[idx]->arg, NULL, 10);
+
return CMD_SUCCESS;
}
@@ -19243,8 +19246,7 @@ DEFUN (community_list_standard,
int style = COMMUNITY_LIST_STANDARD;
int idx = 0;
- argv_find(argv, argc, "(0-4294967295)", &idx);
- if (idx)
+ if (argv_find(argv, argc, "(0-4294967295)", &idx))
seq = argv[idx]->arg;
idx = 0;
@@ -19292,8 +19294,7 @@ DEFUN (no_community_list_standard_all,
char *seq = NULL;
int idx = 0;
- argv_find(argv, argc, "(0-4294967295)", &idx);
- if (idx)
+ if (argv_find(argv, argc, "(0-4294967295)", &idx))
seq = argv[idx]->arg;
idx = 0;
@@ -19356,8 +19357,7 @@ DEFUN (community_list_expanded_all,
int style = COMMUNITY_LIST_EXPANDED;
int idx = 0;
- argv_find(argv, argc, "(0-4294967295)", &idx);
- if (idx)
+ if (argv_find(argv, argc, "(0-4294967295)", &idx))
seq = argv[idx]->arg;
idx = 0;
@@ -19406,8 +19406,7 @@ DEFUN (no_community_list_expanded_all,
int style = COMMUNITY_LIST_EXPANDED;
int idx = 0;
- argv_find(argv, argc, "(0-4294967295)", &idx);
- if (idx)
+ if (argv_find(argv, argc, "(0-4294967295)", &idx))
seq = argv[idx]->arg;
idx = 0;