mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 00:13:40 +00:00
[daemons] Sanity check port number arguments before use
2008-05-29 Martin Nagy <mnagy@redhat.com> * */*main.c: Sanity check port numbers before using.
This commit is contained in:
parent
768a27ea7b
commit
0d6b2ee249
@ -1,3 +1,7 @@
|
||||
2008-05-29 Martin Nagy <mnagy@redhat.com>
|
||||
|
||||
* */*main.c: Sanity check port numbers before using.
|
||||
|
||||
2008-01-30 Peter Szilagyi <sp615@hszk.bme.hu>
|
||||
|
||||
* lib/stream.h: Remove named 'new' parameter in prototype
|
||||
|
@ -203,6 +203,7 @@ main (int argc, char **argv)
|
||||
int dryrun = 0;
|
||||
char *progname;
|
||||
struct thread thread;
|
||||
int tmp_port;
|
||||
|
||||
/* Set umask before anything for security */
|
||||
umask (0027);
|
||||
@ -238,7 +239,11 @@ main (int argc, char **argv)
|
||||
pid_file = optarg;
|
||||
break;
|
||||
case 'p':
|
||||
bm->port = atoi (optarg);
|
||||
tmp_port = atoi (optarg);
|
||||
if (tmp_port <= 0 || tmp_port > 0xffff)
|
||||
bm->port = BGP_PORT_DEFAULT;
|
||||
else
|
||||
bm->port = tmp_port;
|
||||
break;
|
||||
case 'A':
|
||||
vty_addr = optarg;
|
||||
@ -252,7 +257,8 @@ main (int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
vty_port = atoi (optarg);
|
||||
vty_port = (vty_port ? vty_port : BGP_VTY_PORT);
|
||||
if (vty_port <= 0 || vty_port > 0xffff)
|
||||
vty_port = BGP_VTY_PORT;
|
||||
break;
|
||||
case 'r':
|
||||
retain_mode = 1;
|
||||
|
@ -227,7 +227,8 @@ main (int argc, char *argv[], char *envp[])
|
||||
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;
|
||||
|
@ -245,7 +245,8 @@ main (int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
vty_port = atoi (optarg);
|
||||
vty_port = (vty_port ? vty_port : OSPF_VTY_PORT);
|
||||
if (vty_port <= 0 || vty_port > 0xffff)
|
||||
vty_port = OSPF_VTY_PORT;
|
||||
break;
|
||||
case 'u':
|
||||
ospfd_privs.user = optarg;
|
||||
|
@ -236,7 +236,8 @@ main (int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
vty_port = atoi (optarg);
|
||||
vty_port = (vty_port ? vty_port : RIP_VTY_PORT);
|
||||
if (vty_port <= 0 || vty_port > 0xffff)
|
||||
vty_port = RIP_VTY_PORT;
|
||||
break;
|
||||
case 'r':
|
||||
retain_mode = 1;
|
||||
|
@ -240,7 +240,8 @@ main (int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
vty_port = atoi (optarg);
|
||||
vty_port = (vty_port ? vty_port : RIPNG_VTY_PORT);
|
||||
if (vty_port <= 0 || vty_port > 0xffff)
|
||||
vty_port = RIPNG_VTY_PORT;
|
||||
break;
|
||||
case 'r':
|
||||
retain_mode = 1;
|
||||
|
@ -275,7 +275,8 @@ main (int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
vty_port = atoi (optarg);
|
||||
vty_port = (vty_port ? vty_port : ZEBRA_VTY_PORT);
|
||||
if (vty_port <= 0 || vty_port > 0xffff)
|
||||
vty_port = ZEBRA_VTY_PORT;
|
||||
break;
|
||||
case 'r':
|
||||
retain_mode = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user