If not set into wtp.conf the client bind to any port

This commit is contained in:
vemax78
2013-05-28 22:22:16 +02:00
parent 16fe0bb6bd
commit 37e60bb755
4 changed files with 35 additions and 20 deletions

View File

@ -20,10 +20,11 @@ static int ac_init(void) {
capwap_network_init(&g_ac.net);
g_ac.mtu = CAPWAP_MTU_DEFAULT;
g_ac.binding = capwap_array_create(sizeof(unsigned short), 0);
g_ac.net.bind_sock_ctrl_port = CAPWAP_CONTROL_PORT;
/* Standard name */
strcpy((char*)g_ac.acname.name, AC_STANDARD_NAME);
/* Descriptor */
g_ac.descriptor.stationlimit = AC_DEFAULT_MAXSTATION;
g_ac.descriptor.maxwtp = AC_DEFAULT_MAXSESSIONS;
@ -477,6 +478,16 @@ static int ac_parsing_configuration_1_0(config_t* config) {
}
}
/* Set network port of WTP */
if (config_lookup_int(config, "application.network.port", &configLongInt) == CONFIG_TRUE) {
if ((configLongInt > 0) && (configLongInt < 65535)) {
g_ac.net.bind_sock_ctrl_port = (unsigned short)configLongInt;
} else {
capwap_logging_error("Invalid configuration file, invalid application.network.port value");
return 0;
}
}
/* Set transport of AC */
if (config_lookup_string(config, "application.network.transport", &configString) == CONFIG_TRUE) {
if (!strcmp(configString, "udp")) {