udp-port can now be unset, and that will disable listening to UDP.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-12-07 17:44:31 +01:00
parent a53c4dba8e
commit 8a919d236f
3 changed files with 21 additions and 20 deletions
+2
View File
@@ -4,6 +4,8 @@
compatibility. Patch by Kevin Cernekee. compatibility. Patch by Kevin Cernekee.
- When a new connection presents a cookie of an existing session - When a new connection presents a cookie of an existing session
the previous session is disconnected (and its IP is hijacked). the previous session is disconnected (and its IP is hijacked).
- If udp-port is unset or set to zero then the server will not listen
for UDP sessions.
* Version 0.2.2 (released 2013-11-23) * Version 0.2.2 (released 2013-11-23)
-3
View File
@@ -452,9 +452,6 @@ static void check_cfg( struct cfg_st *config)
if (config->dpd == 0) if (config->dpd == 0)
config->keepalive = 60; config->keepalive = 60;
if (config->udp_port == 0)
config->udp_port = config->port;
if (config->priorities == NULL) if (config->priorities == NULL)
config->priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT"; config->priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT";
} }
+2
View File
@@ -209,6 +209,7 @@ listen_ports(struct cfg_st* config, struct listen_list_st *list, const char *nod
exit(1); exit(1);
} }
if (config->udp_port) {
snprintf(portname, sizeof(portname), "%d", config->udp_port); snprintf(portname, sizeof(portname), "%d", config->udp_port);
memset(&hints, 0, sizeof(hints)); memset(&hints, 0, sizeof(hints));
@@ -232,6 +233,7 @@ listen_ports(struct cfg_st* config, struct listen_list_st *list, const char *nod
} }
freeaddrinfo(res); freeaddrinfo(res);
}
return 0; return 0;
} }