diff options
author | paul <paul> | 2003-01-22 20:47:09 +0100 |
---|---|---|
committer | paul <paul> | 2003-01-22 20:47:09 +0100 |
commit | 4fc4e7ab47fef3295d0ae40e064fc99478c24e23 (patch) | |
tree | 82e0d2dd400ca4bf14138ac484120085244d2d25 /ripngd/ripng_main.c | |
parent | Matthew Grant <grantma@anathoth.gen.nz> (diff) | |
download | frr-4fc4e7ab47fef3295d0ae40e064fc99478c24e23.tar.xz frr-4fc4e7ab47fef3295d0ae40e064fc99478c24e23.zip |
Matthew Grant <grantma@anathoth.gen.nz>
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b
portfix patch
Diffstat (limited to 'ripngd/ripng_main.c')
-rw-r--r-- | ripngd/ripng_main.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c index aec74bb4f..3a7ed4a07 100644 --- a/ripngd/ripng_main.c +++ b/ripngd/ripng_main.c @@ -155,7 +155,7 @@ main (int argc, char **argv) { char *p; char *vty_addr = NULL; - int vty_port = 0; + int vty_port = RIPNG_VTY_PORT; int daemon_mode = 0; char *config_file = NULL; char *progname; @@ -197,10 +197,18 @@ main (int argc, char **argv) break; case 'i': pid_file = optarg; - break; + break; case 'P': - vty_port = atoi (optarg); - break; + /* Deal with atoi() returning 0 on failure, and ripngd not + listening on ripngd port... */ + if (strcmp(optarg, "0") == 0) + { + vty_port = 0; + break; + } + vty_port = atoi (optarg); + vty_port = (vty_port ? vty_port : RIPNG_VTY_PORT); + break; case 'r': retain_mode = 1; break; @@ -237,8 +245,7 @@ main (int argc, char **argv) daemon (0, 0); /* Create VTY socket */ - vty_serv_sock (vty_addr, - vty_port ? vty_port : RIPNG_VTY_PORT, RIPNG_VTYSH_PATH); + vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH); /* Process id file create. */ pid_output (pid_file); |