]> git.proxmox.com Git - mirror_frr.git/commitdiff
Matthew Grant <grantma@anathoth.gen.nz>
authorpaul <paul>
Wed, 22 Jan 2003 19:47:09 +0000 (19:47 +0000)
committerpaul <paul>
Wed, 22 Jan 2003 19:47:09 +0000 (19:47 +0000)
[zebra 17290] [PATCHES] - Fixes for problems in 0.93b

portfix patch

bgpd/bgp_main.c
ospf6d/ospf6_main.c
ospfd/ospf_main.c
ripd/rip_main.c
ripngd/ripng_main.c
zebra/main.c

index 7fc68fa76b35218613f0d76f47016dc7d576d50d..703779147024831cec7e445c2f8cf7e13539351e 100644 (file)
@@ -113,7 +113,7 @@ sighup (int sig)
   vty_read_config (config_file, config_current, config_default);
 
   /* Create VTY's socket */
-  vty_serv_sock (vty_addr, vty_port ? vty_port : BGP_VTY_PORT, BGP_VTYSH_PATH);
+  vty_serv_sock (vty_addr, vty_port, BGP_VTYSH_PATH);
 
   /* Try to return to normal operation. */
 }
@@ -222,7 +222,15 @@ main (int argc, char **argv)
          vty_addr = optarg;
          break;
        case 'P':
-         vty_port = atoi (optarg);
+          /* Deal with atoi() returning 0 on failure, and bgpd not
+             listening on bgp port... */
+          if (strcmp(optarg, "0") == 0) 
+            {
+              vty_port = 0;
+              break;
+            } 
+          vty_port = atoi (optarg);
+          vty_port = (vty_port ? vty_port : BGP_VTY_PORT);
          break;
        case 'r':
          retain_mode = 1;
index 5ab517f360688881c2785681ec9cad51bdc1a916..3f3d5508d5b6f2222a7a68c2666b8dfc6b6f9908 100644 (file)
@@ -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",
index 82960b249ea7088c49e8adb7bb1bfe5bb518e5c5..6f6262aa6f4a97ef34776754c7b516f3939bee5b 100644 (file)
@@ -170,7 +170,7 @@ main (int argc, char **argv)
 {
   char *p;
   char *vty_addr = NULL;
-  int vty_port = 0;
+  int vty_port = OSPF_VTY_PORT;
   int daemon_mode = 0;
   char *config_file = NULL;
   char *progname;
@@ -219,8 +219,16 @@ main (int argc, char **argv)
           pid_file = optarg;
           break;
        case 'P':
-         vty_port = atoi (optarg);
-         break;
+          /* Deal with atoi() returning 0 on failure, and ospfd not
+             listening on ospfd port... */
+          if (strcmp(optarg, "0") == 0) 
+            {
+              vty_port = 0;
+              break;
+            } 
+          vty_port = atoi (optarg);
+          vty_port = (vty_port ? vty_port : OSPF_VTY_PORT);
+         break;
        case 'v':
          print_version (progname);
          exit (0);
@@ -277,8 +285,7 @@ main (int argc, char **argv)
   pid_output (pid_file);
 
   /* Create VTY socket */
-  vty_serv_sock (vty_addr,
-                vty_port ? vty_port : OSPF_VTY_PORT, OSPF_VTYSH_PATH);
+  vty_serv_sock (vty_addr, vty_port, OSPF_VTYSH_PATH);
 
   /* Print banner. */
   zlog (NULL, LOG_INFO, "OSPFd (%s) starts", ZEBRA_VERSION);
index 1070fb456aad8c9a2b3e21c6e90b4289653819bf..5e560524ae11cd0ea92f1f9aaea11d90790a28fd 100644 (file)
@@ -211,7 +211,15 @@ main (int argc, char **argv)
           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;
index aec74bb4f2b547613cee5f2d39a757bb4ba2636c..3a7ed4a073e9c54828f1be493b5ebab898328dcc 100644 (file)
@@ -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);
index 25d8b6de28b8dadb5841cdcc5966435937fd2579..66469a2f0d6bd255893e98cfd5a51d2da3a6ae02 100644 (file)
@@ -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);