Matthew Grant <grantma@anathoth.gen.nz>

[zebra 17290] [PATCHES] - Fixes for problems in 0.93b

portfix patch
This commit is contained in:
paul 2003-01-22 19:47:09 +00:00
parent d753e9eec9
commit 4fc4e7ab47
6 changed files with 65 additions and 21 deletions

View File

@ -113,7 +113,7 @@ sighup (int sig)
vty_read_config (config_file, config_current, config_default); vty_read_config (config_file, config_current, config_default);
/* Create VTY's socket */ /* 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. */ /* Try to return to normal operation. */
} }
@ -222,7 +222,15 @@ main (int argc, char **argv)
vty_addr = optarg; vty_addr = optarg;
break; break;
case 'P': case 'P':
/* 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 = atoi (optarg);
vty_port = (vty_port ? vty_port : BGP_VTY_PORT);
break; break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;

View File

@ -206,7 +206,7 @@ main (int argc, char *argv[], char *envp[])
char *p; char *p;
int opt; int opt;
char *vty_addr = NULL; char *vty_addr = NULL;
int vty_port = 0; int vty_port = OSPF6_VTY_PORT;
char *config_file = NULL; char *config_file = NULL;
char *progname; char *progname;
struct thread thread; struct thread thread;
@ -253,7 +253,15 @@ main (int argc, char *argv[], char *envp[])
pid_file = optarg; pid_file = optarg;
break; break;
case 'P': 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); vty_port = atoi (optarg);
vty_port = (vty_port ? vty_port : OSPF6_VTY_PORT);
break; break;
case 'v': case 'v':
print_version (progname); print_version (progname);
@ -305,8 +313,7 @@ main (int argc, char *argv[], char *envp[])
thread_add_read (master, ospf6_receive, NULL, ospf6_sock); thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
/* Make ospf vty socket. */ /* Make ospf vty socket. */
vty_serv_sock (vty_addr, vty_serv_sock (vty_addr, vty_port, OSPF6_VTYSH_PATH);
vty_port ? vty_port : OSPF6_VTY_PORT, OSPF6_VTYSH_PATH);
/* Print start message */ /* Print start message */
zlog_notice ("OSPF6d (Zebra-%s ospf6d-%s) starts", zlog_notice ("OSPF6d (Zebra-%s ospf6d-%s) starts",

View File

@ -170,7 +170,7 @@ main (int argc, char **argv)
{ {
char *p; char *p;
char *vty_addr = NULL; char *vty_addr = NULL;
int vty_port = 0; int vty_port = OSPF_VTY_PORT;
int daemon_mode = 0; int daemon_mode = 0;
char *config_file = NULL; char *config_file = NULL;
char *progname; char *progname;
@ -219,7 +219,15 @@ main (int argc, char **argv)
pid_file = optarg; pid_file = optarg;
break; break;
case 'P': case 'P':
/* 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 = atoi (optarg);
vty_port = (vty_port ? vty_port : OSPF_VTY_PORT);
break; break;
case 'v': case 'v':
print_version (progname); print_version (progname);
@ -277,8 +285,7 @@ main (int argc, char **argv)
pid_output (pid_file); pid_output (pid_file);
/* Create VTY socket */ /* Create VTY socket */
vty_serv_sock (vty_addr, vty_serv_sock (vty_addr, vty_port, OSPF_VTYSH_PATH);
vty_port ? vty_port : OSPF_VTY_PORT, OSPF_VTYSH_PATH);
/* Print banner. */ /* Print banner. */
zlog (NULL, LOG_INFO, "OSPFd (%s) starts", ZEBRA_VERSION); zlog (NULL, LOG_INFO, "OSPFd (%s) starts", ZEBRA_VERSION);

View File

@ -211,7 +211,15 @@ main (int argc, char **argv)
pid_file = optarg; pid_file = optarg;
break; break;
case 'P': case 'P':
/* 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 = atoi (optarg);
vty_port = (vty_port ? vty_port : RIP_VTY_PORT);
break; break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;

View File

@ -155,7 +155,7 @@ main (int argc, char **argv)
{ {
char *p; char *p;
char *vty_addr = NULL; char *vty_addr = NULL;
int vty_port = 0; int vty_port = RIPNG_VTY_PORT;
int daemon_mode = 0; int daemon_mode = 0;
char *config_file = NULL; char *config_file = NULL;
char *progname; char *progname;
@ -199,7 +199,15 @@ main (int argc, char **argv)
pid_file = optarg; pid_file = optarg;
break; break;
case 'P': case 'P':
/* 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 = atoi (optarg);
vty_port = (vty_port ? vty_port : RIPNG_VTY_PORT);
break; break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
@ -237,8 +245,7 @@ main (int argc, char **argv)
daemon (0, 0); daemon (0, 0);
/* Create VTY socket */ /* Create VTY socket */
vty_serv_sock (vty_addr, vty_serv_sock (vty_addr, vty_port, RIPNG_VTYSH_PATH);
vty_port ? vty_port : RIPNG_VTY_PORT, RIPNG_VTYSH_PATH);
/* Process id file create. */ /* Process id file create. */
pid_output (pid_file); pid_output (pid_file);

View File

@ -174,7 +174,7 @@ main (int argc, char **argv)
{ {
char *p; char *p;
char *vty_addr = NULL; char *vty_addr = NULL;
int vty_port = 0; int vty_port = ZEBRA_VTY_PORT;
int batch_mode = 0; int batch_mode = 0;
int daemon_mode = 0; int daemon_mode = 0;
char *config_file = NULL; char *config_file = NULL;
@ -226,7 +226,15 @@ main (int argc, char **argv)
pid_file = optarg; pid_file = optarg;
break; break;
case 'P': 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 = atoi (optarg);
vty_port = (vty_port ? vty_port : ZEBRA_VTY_PORT);
break; break;
case 'r': case 'r':
retain_mode = 1; retain_mode = 1;
@ -305,8 +313,7 @@ main (int argc, char **argv)
pid = getpid (); pid = getpid ();
/* Make vty server socket. */ /* Make vty server socket. */
vty_serv_sock (vty_addr, vty_serv_sock (vty_addr, vty_port, ZEBRA_VTYSH_PATH);
vty_port ? vty_port : ZEBRA_VTY_PORT, ZEBRA_VTYSH_PATH);
while (thread_fetch (master, &thread)) while (thread_fetch (master, &thread))
thread_call (&thread); thread_call (&thread);