diff --git a/infrastructure-centred/owlps-listener/owlps-listenerd.c b/infrastructure-centred/owlps-listener/owlps-listenerd.c index b9c2d67..3d3dd39 100644 --- a/infrastructure-centred/owlps-listener/owlps-listenerd.c +++ b/infrastructure-centred/owlps-listener/owlps-listenerd.c @@ -397,6 +397,38 @@ void check_configuration() " the aggregation IP as the destination of" " autocalibration requests.\n") ; } + + // Port numbers // + if (GET_AGGREGATION_PORT() < 1 || GET_AGGREGATION_PORT() > 65535) + { + if (GET_VERBOSE()) + fprintf(stderr, "Warning! Bad aggregation_port:" + " failing back to the default value.\n") ; + SET_AGGREGATION_PORT(AGGREGATE_DEFAULT_PORT) ; + } + if (GET_LISTENING_PORT() < 1 || GET_LISTENING_PORT() > 65535) + { + if (GET_VERBOSE()) + fprintf(stderr, "Warning! Bad listening_port:" + " failing back to the default value.\n") ; + SET_LISTENING_PORT(LOC_REQUEST_DEFAULT_PORT) ; + } + if (GET_AUTOCALIBRATION_REQUEST_PORT() < 1 || + GET_AUTOCALIBRATION_REQUEST_PORT() > 65535) + { + if (GET_VERBOSE()) + fprintf(stderr, "Warning! Bad autocalibration_request_port:" + " failing back to the default value.\n") ; + SET_AUTOCALIBRATION_REQUEST_PORT(DEFAULT_AUTOCALIBRATION_REQUEST_PORT) ; + } + if (GET_AUTOCALIBRATION_PORT() < 1 || + GET_AUTOCALIBRATION_PORT() > 65535) + { + if (GET_VERBOSE()) + fprintf(stderr, "Warning! Bad autocalibration_port:" + " failing back to the default value.\n") ; + SET_AUTOCALIBRATION_PORT(DEFAULT_AUTOCALIBRATION_PORT) ; + } }