Skip to content

Commit

Permalink
Demote and extend 'TCP repair off' failure log.
Browse files Browse the repository at this point in the history
The error in tcp_repair_off() is ignored, so log it as a warning.
Include the file descriptor and error code in the debug message to make
it more useful.

Fixes: e7ba909 (2016-03-14 "cr-check: Inspect errno on syscall failures")
Signed-off-by: Michał Mirosław <[email protected]>
  • Loading branch information
osctobe committed Jun 19, 2023
1 parent 45f8a98 commit 3565e4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion criu/include/sk-inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ extern int inet_connect(int sk, struct inet_sk_info *);

#ifdef CR_NOGLIBC
#define setsockopt sys_setsockopt
#define pr_pwarn(fmt, ...) pr_warn(fmt ": %d\n", ##__VA_ARGS__, ret)
#endif
static inline void tcp_repair_off(int fd)
{
int aux = 0, ret;

ret = setsockopt(fd, SOL_TCP, TCP_REPAIR, &aux, sizeof(aux));
if (ret < 0)
pr_err("Failed to turn off repair mode on socket\n");
pr_pwarn("Failed to turn off repair mode on socket %d", fd);
}

extern void tcp_locked_conn_add(struct inet_sk_info *);
Expand Down

0 comments on commit 3565e4d

Please sign in to comment.