mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
zdtm: add alternative socket filter
A little rework of sock_filter test to be able to use it with different filters Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
5c4cc46fdc
commit
c7726b7f35
@@ -44,7 +44,8 @@ TST_NOFILE := \
|
|||||||
packet_sock \
|
packet_sock \
|
||||||
packet_sock_mmap \
|
packet_sock_mmap \
|
||||||
packet_sock_spkt \
|
packet_sock_spkt \
|
||||||
sock_filter \
|
sock_filter00 \
|
||||||
|
sock_filter01 \
|
||||||
msgque \
|
msgque \
|
||||||
inotify_system \
|
inotify_system \
|
||||||
inotify_system_nodel \
|
inotify_system_nodel \
|
||||||
@@ -515,6 +516,7 @@ msgque: CFLAGS += -DNEW_IPC_NS
|
|||||||
sem: CFLAGS += -DNEW_IPC_NS
|
sem: CFLAGS += -DNEW_IPC_NS
|
||||||
posix_timers: LDLIBS += -lrt -pthread
|
posix_timers: LDLIBS += -lrt -pthread
|
||||||
remap_dead_pid_root: CFLAGS += -DREMAP_PID_ROOT
|
remap_dead_pid_root: CFLAGS += -DREMAP_PID_ROOT
|
||||||
|
sock_filter01: CFLAGS += -DSOCK_FILTER01
|
||||||
socket-tcp6: CFLAGS += -D ZDTM_IPV6
|
socket-tcp6: CFLAGS += -D ZDTM_IPV6
|
||||||
socket-tcp4v6: CFLAGS += -D ZDTM_IPV4V6
|
socket-tcp4v6: CFLAGS += -D ZDTM_IPV4V6
|
||||||
socket-tcpbuf6: CFLAGS += -D ZDTM_IPV6
|
socket-tcpbuf6: CFLAGS += -D ZDTM_IPV6
|
||||||
|
@@ -15,12 +15,24 @@ const char *test_author = "Pavel Emelyanov <xemul@parallels.com>";
|
|||||||
#define SO_GET_FILTER SO_ATTACH_FILTER
|
#define SO_GET_FILTER SO_ATTACH_FILTER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SOCK_FILTER01
|
||||||
|
#define SFLEN 4
|
||||||
|
#else
|
||||||
#define SFLEN 14
|
#define SFLEN 14
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int sk;
|
int sk;
|
||||||
struct sock_fprog p;
|
struct sock_fprog p;
|
||||||
|
#ifdef SOCK_FILTER01
|
||||||
|
struct sock_filter f[SFLEN] = {
|
||||||
|
{ 0x6, 0, 0, 0x0000ffff },
|
||||||
|
{ 0x6, 0, 0, 0x0000ffff },
|
||||||
|
{ 0x6, 0, 0, 0x0000ffff },
|
||||||
|
{ 0x6, 0, 0, 0x0000ffff },
|
||||||
|
};
|
||||||
|
#else
|
||||||
struct sock_filter f[SFLEN] = {
|
struct sock_filter f[SFLEN] = {
|
||||||
{ 0x28, 0, 0, 0x0000000c },
|
{ 0x28, 0, 0, 0x0000000c },
|
||||||
{ 0x15, 0, 4, 0x00000800 },
|
{ 0x15, 0, 4, 0x00000800 },
|
||||||
@@ -37,6 +49,7 @@ int main(int argc, char **argv)
|
|||||||
{ 0x6, 0, 0, 0x0000ffff },
|
{ 0x6, 0, 0, 0x0000ffff },
|
||||||
{ 0x6, 0, 0, 0x00000000 },
|
{ 0x6, 0, 0, 0x00000000 },
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
struct sock_filter f2[SFLEN], f3[SFLEN];
|
struct sock_filter f2[SFLEN], f3[SFLEN];
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
|
|
1
test/zdtm/static/sock_filter01.c
Symbolic link
1
test/zdtm/static/sock_filter01.c
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
sock_filter00.c
|
Reference in New Issue
Block a user