[Listener] Do not print a warning if AC_port == 0

If the autocalibration request port was not specified, a warning was
issued. This is now fixed by issuing a warning only if the port is too
big, but not if it is zero.
This commit is contained in:
Matteo Cypriani 2012-05-14 14:06:05 +02:00
parent c4e03520f3
commit e239dffa4f
1 changed files with 22 additions and 24 deletions

View File

@ -92,28 +92,28 @@ struct {
#endif // USE_PTHREAD
uint_fast8_t verbose ;
} options = { // Initalise default options:
owl_false,
MODE_ACTIVE,
"127.0.0.1",
OWL_DEFAULT_LISTENER_PORT,
OWL_DEFAULT_REQUEST_PORT,
owl_false, // daemon
MODE_ACTIVE, // mode
"127.0.0.1", // aggregation_ip
OWL_DEFAULT_LISTENER_PORT, // aggregation_port
OWL_DEFAULT_REQUEST_PORT, // listening_port
#ifdef ENABLE_KEEP_MONITOR
owl_false,
owl_false, // keep_monitor
#endif // ENABLE_KEEP_MONITOR
"",
"",
"", // rtap_iface
"", // wifi_iface
#ifdef USE_PTHREAD
owl_false,
"",
0,
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT,
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT,
DEFAULT_AUTOCALIBRATION_HELLO_DELAY,
DEFAULT_AUTOCALIBRATION_DELAY,
DEFAULT_AUTOCALIBRATION_NBPKT,
0, 0, 0, 0,
owl_false, // autocalibration
"", // autocalibration_ip
0, // autocalibration_request_port
OWL_DEFAULT_AUTOCALIBRATION_ORDER_PORT, // autocalibration_order_port
OWL_DEFAULT_AUTOCALIBRATION_HELLO_PORT, // autocalibration_hello_port
DEFAULT_AUTOCALIBRATION_HELLO_DELAY, // autocalibration_hello_delay
DEFAULT_AUTOCALIBRATION_DELAY, // autocalibration_delay
DEFAULT_AUTOCALIBRATION_NBPKT, // autocalibration_nb_packets
0, 0, 0, 0, // Calibration data
#endif // USE_PTHREAD
0
0 // verbose
} ;
#endif // USE_CONFIG_FILE
@ -660,14 +660,12 @@ int check_configuration()
" direction.\n", (int) GET_MY_DIRECTION()) ;
// Autocalibration port numbers
if (GET_AUTOCALIBRATION_REQUEST_PORT() > 65535 && VERBOSE_WARNING)
fprintf(stderr, "Warning! Bad autocalibration_request_port:"
" failing back to the default value.\n") ;
if (GET_AUTOCALIBRATION_REQUEST_PORT() < 1 ||
GET_AUTOCALIBRATION_REQUEST_PORT() > 65535)
{
if (VERBOSE_WARNING)
fprintf(stderr, "Warning! Bad autocalibration_request_port:"
" failing back to the default value.\n") ;
SET_AUTOCALIBRATION_REQUEST_PORT(GET_LISTENING_PORT()) ;
}
SET_AUTOCALIBRATION_REQUEST_PORT(GET_LISTENING_PORT()) ;
if (GET_AUTOCALIBRATION_ORDER_PORT() < 1 ||
GET_AUTOCALIBRATION_ORDER_PORT() > 65535)
{