summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorpaul <paul>2003-01-22 19:47:09 +0000
committerpaul <paul>2003-01-22 19:47:09 +0000
commit4fc4e7ab47fef3295d0ae40e064fc99478c24e23 (patch)
tree82e0d2dd400ca4bf14138ac484120085244d2d25 /bgpd
parentd753e9eec96f03aa02a7648e4279c524c376908d (diff)
Matthew Grant <grantma@anathoth.gen.nz>
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b portfix patch
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index 7fc68fa7..70377914 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -113,7 +113,7 @@ sighup (int sig)
vty_read_config (config_file, config_current, config_default);
/* Create VTY's socket */
- vty_serv_sock (vty_addr, vty_port ? vty_port : BGP_VTY_PORT, BGP_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, BGP_VTYSH_PATH);
/* Try to return to normal operation. */
}
@@ -222,7 +222,15 @@ main (int argc, char **argv)
vty_addr = optarg;
break;
case 'P':
- vty_port = atoi (optarg);
+ /* Deal with atoi() returning 0 on failure, and bgpd not
+ listening on bgp port... */
+ if (strcmp(optarg, "0") == 0)
+ {
+ vty_port = 0;
+ break;
+ }
+ vty_port = atoi (optarg);
+ vty_port = (vty_port ? vty_port : BGP_VTY_PORT);
break;
case 'r':
retain_mode = 1;