summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_vty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index f9d845dcd1..0203f3647d 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -1007,7 +1007,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
u_int16_t options, int set)
{
struct bgp *bgp;
- u_int16_t maxpaths = strtol(mpaths, NULL, 10);
+ u_int16_t maxpaths = 0;
int ret;
afi_t afi;
safi_t safi;
@@ -1017,7 +1017,10 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
safi = bgp_node_safi (vty);
if (set)
+ {
+ strtol(mpaths, NULL, 10);
ret = bgp_maximum_paths_set (bgp, afi, safi, peer_type, maxpaths, options);
+ }
else
ret = bgp_maximum_paths_unset (bgp, afi, safi, peer_type);