#define DIR_PERM_OK W_OK|X_OK
#endif
+#define MAX_TCP_TIMEOUT 65535
+
/*%
* Check an operation for failure. Assumes that the function
* using it has a 'result' variable and a 'cleanup' label.
result = named_config_get(maps, "tcp-keepalive-timeout", &obj);
INSIST(result == ISC_R_SUCCESS);
keepalive = cfg_obj_asuint32(obj);
- if (keepalive > 1200) {
+ if (keepalive > MAX_TCP_TIMEOUT) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-keepalive-timeout value is out of range: "
- "lowering to 1200");
- keepalive = 1200;
+ "lowering to %u", MAX_TCP_TIMEOUT);
+ keepalive = MAX_TCP_TIMEOUT;
} else if (keepalive < 1) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-keepalive-timeout value is out of range: "
result = named_config_get(maps, "tcp-advertised-timeout", &obj);
INSIST(result == ISC_R_SUCCESS);
advertised = cfg_obj_asuint32(obj);
- if (advertised > 1200) {
+ if (advertised > MAX_TCP_TIMEOUT) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-advertized-timeout value is out of range: "
- "lowering to 1200");
- advertised = 1200;
+ "lowering to %u", MAX_TCP_TIMEOUT);
+ advertised = MAX_TCP_TIMEOUT;
}
ns_server_settimeouts(named_g_server->sctx,
if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND);
CHECK(isc_parse_uint32(&keepalive, ptr, 10));
- if (keepalive > 1200)
+ if (keepalive > MAX_TCP_TIMEOUT)
CHECK(ISC_R_RANGE);
if (keepalive < 1)
CHECK(ISC_R_RANGE);
if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND);
CHECK(isc_parse_uint32(&advertised, ptr, 10));
- if (advertised > 1200)
+ if (advertised > MAX_TCP_TIMEOUT)
CHECK(ISC_R_RANGE);
result = isc_task_beginexclusive(named_g_server->task);
server waits on an idle TCP connection before closing
it when the client is using the EDNS TCP keepalive
option. The default is 300 (30 seconds), the maximum
- is 1200 (two minutes), and the minimum is 1 (one tenth
+ is 65535 (about 1.8 hours), and the minimum is 1 (one tenth
of a second). Values above the maximum or below the minimum
will be adjusted with a logged warning.
This value may be greater than
keepalive option. This informs a client of the
amount of time it may keep the session open.
The default is 300 (30 seconds), the maximum is
- 1200 (two minutes), and the minimum is 0, which
+ 65535 (about 1.8 hours), and the minimum is 0, which
signals that the clients must close TCP connections
immediately. Ordinarily this should be set to the
same value as <command>tcp-keepalive-timeout</command>.