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. */
}
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;
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;
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);
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",
{
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;
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);
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);
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;
{
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;
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;
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);
{
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;
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;
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);