[Client] check_configuration(): check port numbers
This commit is contained in:
parent
b88f26e503
commit
2fb30970ad
|
@ -227,6 +227,23 @@ void check_configuration()
|
||||||
options.nb_pkt = DEFAULT_NBPKT_NORMAL ;
|
options.nb_pkt = DEFAULT_NBPKT_NORMAL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check port numbers
|
||||||
|
if (options.dest_port < 1 || options.dest_port > 65535)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "Warning! Bad dest_port:"
|
||||||
|
" failing back to default value.\n") ;
|
||||||
|
options.dest_port = LOC_REQUEST_DEFAULT_PORT ;
|
||||||
|
#endif // DEBUG
|
||||||
|
}
|
||||||
|
if (options.listening_port > 65535)
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
fprintf(stderr, "Warning! listening_port too high: ignored.\n") ;
|
||||||
|
options.listening_port = 0 ;
|
||||||
|
#endif // DEBUG
|
||||||
|
}
|
||||||
|
|
||||||
// We want to send a calibration request AND to be located, which is
|
// We want to send a calibration request AND to be located, which is
|
||||||
// not allowed:
|
// not allowed:
|
||||||
if (is_calibration_request && options.listening_port > 0)
|
if (is_calibration_request && options.listening_port > 0)
|
||||||
|
|
Loading…
Reference in New Issue