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 --- ospf6d/ospf6_main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ospf6d/ospf6_main.c') 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", -- cgit v1.2.1