projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: leak of filter bytecode and expression on agent event re-enable
[lttng-tools.git]
/
src
/
bin
/
lttng-relayd
/
tcp_keep_alive.c
diff --git
a/src/bin/lttng-relayd/tcp_keep_alive.c
b/src/bin/lttng-relayd/tcp_keep_alive.c
index 4a2cd9f1bd84d8427db624c5d66a22c598489594..0cadbad74e6c4309eee2c2d1c0d54ed2c02ea1a1 100644
(file)
--- a/
src/bin/lttng-relayd/tcp_keep_alive.c
+++ b/
src/bin/lttng-relayd/tcp_keep_alive.c
@@
-36,7
+36,6
@@
/* Per-platform definitions of TCP socket options. */
#if defined (__linux__)
/* Per-platform definitions of TCP socket options. */
#if defined (__linux__)
-#define COMPAT_SOCKET_LEVEL SOL_TCP
#define COMPAT_TCP_LEVEL SOL_TCP
#define COMPAT_TCP_ABORT_THRESHOLD 0 /* Does not exist on linux. */
#define COMPAT_TCP_KEEPIDLE TCP_KEEPIDLE
#define COMPAT_TCP_LEVEL SOL_TCP
#define COMPAT_TCP_ABORT_THRESHOLD 0 /* Does not exist on linux. */
#define COMPAT_TCP_KEEPIDLE TCP_KEEPIDLE
@@
-45,7
+44,6
@@
#elif defined (__sun__) /* ! defined (__linux__) */
#elif defined (__sun__) /* ! defined (__linux__) */
-#define COMPAT_SOCKET_LEVEL SOL_SOCKET
#define COMPAT_TCP_LEVEL IPPROTO_TCP
#ifdef TCP_KEEPALIVE_THRESHOLD
#define COMPAT_TCP_LEVEL IPPROTO_TCP
#ifdef TCP_KEEPALIVE_THRESHOLD
@@
-65,7
+63,6
@@
#else /* ! defined (__linux__) && ! defined (__sun__) */
#else /* ! defined (__linux__) && ! defined (__sun__) */
-#define COMPAT_SOCKET_LEVEL 0
#define COMPAT_TCP_LEVEL 0
#define COMPAT_TCP_ABORT_THRESHOLD 0
#define COMPAT_TCP_KEEPIDLE 0
#define COMPAT_TCP_LEVEL 0
#define COMPAT_TCP_ABORT_THRESHOLD 0
#define COMPAT_TCP_KEEPIDLE 0
@@
-547,7
+544,8
@@
int socket_apply_keep_alive_config(int socket_fd)
goto end;
}
goto end;
}
- ret = setsockopt(socket_fd, COMPAT_SOCKET_LEVEL, SO_KEEPALIVE, &val,
+ DBG("TCP keep-alive enabled for socket %d", socket_fd);
+ ret = setsockopt(socket_fd, SOL_SOCKET, SO_KEEPALIVE, &val,
sizeof(val));
if (ret < 0) {
PERROR("setsockopt so_keepalive");
sizeof(val));
if (ret < 0) {
PERROR("setsockopt so_keepalive");
@@
-556,6
+554,7
@@
int socket_apply_keep_alive_config(int socket_fd)
/* TCP keep-alive idle time */
if (support.idle_time_supported && config.idle_time > 0) {
/* TCP keep-alive idle time */
if (support.idle_time_supported && config.idle_time > 0) {
+ DBG("TCP keep-alive keep idle: %d enabled for socket %d", config.idle_time, socket_fd);
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPIDLE, &config.idle_time,
sizeof(config.idle_time));
if (ret < 0) {
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPIDLE, &config.idle_time,
sizeof(config.idle_time));
if (ret < 0) {
@@
-565,6
+564,7
@@
int socket_apply_keep_alive_config(int socket_fd)
}
/* TCP keep-alive probe interval */
if (support.probe_interval_supported && config.probe_interval > 0) {
}
/* TCP keep-alive probe interval */
if (support.probe_interval_supported && config.probe_interval > 0) {
+ DBG("TCP keep-alive probe_interval: %d enabled for socket %d", config.probe_interval, socket_fd);
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPINTVL, &config.probe_interval,
sizeof(config.probe_interval));
if (ret < 0) {
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPINTVL, &config.probe_interval,
sizeof(config.probe_interval));
if (ret < 0) {
@@
-575,6
+575,7
@@
int socket_apply_keep_alive_config(int socket_fd)
/* TCP keep-alive max probe count */
if (support.max_probe_count_supported && config.max_probe_count > 0) {
/* TCP keep-alive max probe count */
if (support.max_probe_count_supported && config.max_probe_count > 0) {
+ DBG("TCP keep-alive max_probe: %d enabled for socket %d", config.max_probe_count, socket_fd);
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPCNT, &config.max_probe_count,
sizeof(config.max_probe_count));
if (ret < 0) {
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_KEEPCNT, &config.max_probe_count,
sizeof(config.max_probe_count));
if (ret < 0) {
@@
-585,6
+586,7
@@
int socket_apply_keep_alive_config(int socket_fd)
/* TCP keep-alive abort threshold */
if (support.abort_threshold_supported && config.abort_threshold > 0) {
/* TCP keep-alive abort threshold */
if (support.abort_threshold_supported && config.abort_threshold > 0) {
+ DBG("TCP keep-alive abort threshold: %d enabled for socket %d", config.abort_threshold, socket_fd);
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_ABORT_THRESHOLD, &config.abort_threshold,
sizeof(config.max_probe_count));
if (ret < 0) {
ret = setsockopt(socket_fd, COMPAT_TCP_LEVEL, COMPAT_TCP_ABORT_THRESHOLD, &config.abort_threshold,
sizeof(config.max_probe_count));
if (ret < 0) {
This page took
0.024782 seconds
and
4
git commands to generate.