mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-16 21:03:17 +00:00
Added port range check, based on patch from Maxim Bourmistrov
This commit is contained in:
parent
ac46718c16
commit
b121f638d0
|
@ -495,10 +495,6 @@ main(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
port = atoi(optarg);
|
port = atoi(optarg);
|
||||||
if (port) {
|
|
||||||
printf("ALERT! Other dns servers expect you to run on port 53.\n");
|
|
||||||
printf("You must manually forward port 53 to port %d for things to work.\n", port);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
strncpy(password, optarg, sizeof(password));
|
strncpy(password, optarg, sizeof(password));
|
||||||
|
@ -548,6 +544,16 @@ main(int argc, char **argv)
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(port < 1 || port > 65535) {
|
||||||
|
warnx("Bad port number given.\n");
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (port != 53) {
|
||||||
|
printf("ALERT! Other dns servers expect you to run on port 53.\n");
|
||||||
|
printf("You must manually forward port 53 to port %d for things to work.\n", port);
|
||||||
|
}
|
||||||
|
|
||||||
if (listen_ip == INADDR_NONE) {
|
if (listen_ip == INADDR_NONE) {
|
||||||
warnx("Bad IP address to listen on.\n");
|
warnx("Bad IP address to listen on.\n");
|
||||||
usage();
|
usage();
|
||||||
|
|
Loading…
Reference in a new issue