From 4fc4e7ab47fef3295d0ae40e064fc99478c24e23 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 22 Jan 2003 19:47:09 +0000 Subject: Matthew Grant [zebra 17290] [PATCHES] - Fixes for problems in 0.93b portfix patch --- bgpd/bgp_main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'bgpd/bgp_main.c') 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; -- cgit v1.2.1