summaryrefslogtreecommitdiff
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
commit4fc4e7ab47fef3295d0ae40e064fc99478c24e23 (patch)
tree82e0d2dd400ca4bf14138ac484120085244d2d25 /ospfd
parentd753e9eec96f03aa02a7648e4279c524c376908d (diff)
Matthew Grant <grantma@anathoth.gen.nz>
[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);