[daemons] Sanity check port number arguments before use

2008-05-29 Martin Nagy <mnagy@redhat.com>

	* */*main.c: Sanity check port numbers before using.
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 8380bc8..680f4b7 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -227,7 +227,8 @@
               break;
             }
           vty_port = atoi (optarg);
-          vty_port = (vty_port ? vty_port : OSPF6_VTY_PORT);
+          if (vty_port <= 0 || vty_port > 0xffff)
+            vty_port = OSPF6_VTY_PORT;
           break;
         case 'u':
           ospf6d_privs.user = optarg;