Commit ef4783a6 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

check: Check for ability to get tcp timestamp

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 04c48fef
......@@ -444,7 +444,7 @@ int cr_check(void)
ret |= check_prctl();
ret |= check_fcntl();
ret |= check_proc_stat();
ret |= check_tcp_repair();
ret |= check_tcp();
ret |= check_fdinfo_ext();
ret |= check_unaligned_vmsplice();
ret |= check_tty();
......
......@@ -70,7 +70,7 @@ int restore_one_tcp(int sk, struct inet_sk_info *si);
struct cr_options;
void show_tcp_stream(int fd, struct cr_options *);
int check_tcp_repair(void);
int check_tcp(void);
extern int rst_tcp_socks_size;
extern int rst_tcp_socks_remap(void *addr);
......
......@@ -671,9 +671,11 @@ out:
pr_img_tail(CR_FD_TCP_STREAM);
}
int check_tcp_repair(void)
int check_tcp(void)
{
socklen_t optlen;
int sk, ret;
int val;
sk = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sk < 0) {
......@@ -682,6 +684,15 @@ int check_tcp_repair(void)
}
ret = tcp_repair_on(sk);
if (ret)
goto out;
optlen = sizeof(val);
ret = getsockopt(sk, SOL_TCP, TCP_TIMESTAMP, &val, &optlen);
if (ret)
pr_perror("Can't get TCP_TIMESTAMP");
out:
close(sk);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment