summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_main.c
diff options
context:
space:
mode:
authorpaul <paul>2003-01-22 19:47:09 +0000
committerpaul <paul>2003-01-22 19:47:09 +0000
commit2ea23faa62122bc9edb98e5346f9818aad0ef946 (patch)
treecaed2f25ead1bf5a3a9f202244bfd8dee84aee23 /bgpd/bgp_main.c
parentdbb3dbb52fa06ce024e116bc804ec655eb949397 (diff)
downloadquagga-patch.z17290.portfix.tar.bz2
quagga-patch.z17290.portfix.tar.xz
Matthew Grant <grantma@anathoth.gen.nz>patch.z17290.portfix
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b portfix patch
Diffstat (limited to 'bgpd/bgp_main.c')
-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;