summaryrefslogtreecommitdiff
path: root/ospf6d
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 /ospf6d
parentd753e9eec96f03aa02a7648e4279c524c376908d (diff)
Matthew Grant <grantma@anathoth.gen.nz>
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b portfix patch
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 5ab517f3..3f3d5508 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -206,7 +206,7 @@ main (int argc, char *argv[], char *envp[])
char *p;
int opt;
char *vty_addr = NULL;
- int vty_port = 0;
+ int vty_port = OSPF6_VTY_PORT;
char *config_file = NULL;
char *progname;
struct thread thread;
@@ -253,8 +253,16 @@ main (int argc, char *argv[], char *envp[])
pid_file = optarg;
break;
case 'P':
+ /* Deal with atoi() returning 0 on failure, and ospf6d not
+ listening on ospf6d port... */
+ if (strcmp(optarg, "0") == 0)
+ {
+ vty_port = 0;
+ break;
+ }
vty_port = atoi (optarg);
- break;
+ vty_port = (vty_port ? vty_port : OSPF6_VTY_PORT);
+ break;
case 'v':
print_version (progname);
exit (0);
@@ -305,8 +313,7 @@ main (int argc, char *argv[], char *envp[])
thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
/* Make ospf vty socket. */
- vty_serv_sock (vty_addr,
- vty_port ? vty_port : OSPF6_VTY_PORT, OSPF6_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH);
/* Print start message */
zlog_notice ("OSPF6d (Zebra-%s ospf6d-%s) starts",