2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

check: Check for ability to get socket filter

This is required to work with tcpdump.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-11-02 16:07:56 +03:00
parent d4735a22fa
commit 64a4c40083

View File

@@ -381,6 +381,30 @@ static int check_unaligned_vmsplice(void)
return 0; return 0;
} }
#ifndef SO_GET_FILTER
#define SO_GET_FILTER SO_ATTACH_FILTER
#endif
static int check_so_get_filter(void)
{
int sk;
socklen_t len;
sk = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sk < 0) {
pr_perror("No socket");
return 1;
}
len = 0;
if (getsockopt(sk, SOL_SOCKET, SO_GET_FILTER, NULL, &len)) {
pr_perror("Can't get socket filter");
return 1;
}
return 0;
}
int cr_check(void) int cr_check(void)
{ {
int ret = 0; int ret = 0;
@@ -402,6 +426,7 @@ int cr_check(void)
ret |= check_fdinfo_ext(); ret |= check_fdinfo_ext();
ret |= check_unaligned_vmsplice(); ret |= check_unaligned_vmsplice();
ret |= check_tty(); ret |= check_tty();
ret |= check_so_get_filter();
if (!ret) if (!ret)
pr_msg("Looks good.\n"); pr_msg("Looks good.\n");