Matthew Grant <grantma@anathoth.gen.nz>
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b
portfix patch
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 1070fb4..5e56052 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -211,7 +211,15 @@
pid_file = optarg;
break;
case 'P':
- vty_port = atoi (optarg);
+ /* Deal with atoi() returning 0 on failure, and ripd not
+ listening on rip port... */
+ if (strcmp(optarg, "0") == 0)
+ {
+ vty_port = 0;
+ break;
+ }
+ vty_port = atoi (optarg);
+ vty_port = (vty_port ? vty_port : RIP_VTY_PORT);
break;
case 'r':
retain_mode = 1;