summaryrefslogtreecommitdiff
path: root/zebra/main.c
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 /zebra/main.c
parentd753e9eec96f03aa02a7648e4279c524c376908d (diff)
Matthew Grant <grantma@anathoth.gen.nz>
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b portfix patch
Diffstat (limited to 'zebra/main.c')
-rw-r--r--zebra/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 25d8b6de..66469a2f 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -174,7 +174,7 @@ main (int argc, char **argv)
{
char *p;
char *vty_addr = NULL;
- int vty_port = 0;
+ int vty_port = ZEBRA_VTY_PORT;
int batch_mode = 0;
int daemon_mode = 0;
char *config_file = NULL;
@@ -226,7 +226,15 @@ main (int argc, char **argv)
pid_file = optarg;
break;
case 'P':
+ /* Deal with atoi() returning 0 on failure, and zebra not
+ listening on zebra port... */
+ if (strcmp(optarg, "0") == 0)
+ {
+ vty_port = 0;
+ break;
+ }
vty_port = atoi (optarg);
+ vty_port = (vty_port ? vty_port : ZEBRA_VTY_PORT);
break;
case 'r':
retain_mode = 1;
@@ -305,8 +313,7 @@ main (int argc, char **argv)
pid = getpid ();
/* Make vty server socket. */
- vty_serv_sock (vty_addr,
- vty_port ? vty_port : ZEBRA_VTY_PORT, ZEBRA_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH);
while (thread_fetch (master, &thread))
thread_call (&thread);