summaryrefslogtreecommitdiffstats
path: root/ospfd
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 /ospfd
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 'ospfd')
-rw-r--r--ospfd/ospf_main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 82960b24..6f6262aa 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -170,7 +170,7 @@ main (int argc, char **argv)
{
char *p;
char *vty_addr = NULL;
- int vty_port = 0;
+ int vty_port = OSPF_VTY_PORT;
int daemon_mode = 0;
char *config_file = NULL;
char *progname;
@@ -219,8 +219,16 @@ main (int argc, char **argv)
pid_file = optarg;
break;
case 'P':
- vty_port = atoi (optarg);
- break;
+ /* Deal with atoi() returning 0 on failure, and ospfd not
+ listening on ospfd port... */
+ if (strcmp(optarg, "0") == 0)
+ {
+ vty_port = 0;
+ break;
+ }
+ vty_port = atoi (optarg);
+ vty_port = (vty_port ? vty_port : OSPF_VTY_PORT);
+ break;
case 'v':
print_version (progname);
exit (0);
@@ -277,8 +285,7 @@ main (int argc, char **argv)
pid_output (pid_file);
/* Create VTY socket */
- vty_serv_sock (vty_addr,
- vty_port ? vty_port : OSPF_VTY_PORT, OSPF_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, OSPF_VTYSH_PATH);
/* Print banner. */
zlog (NULL, LOG_INFO, "OSPFd (%s) starts", ZEBRA_VERSION);