Спасибо!
IMHO это то что надо.
сейчас я как раз разбираюсь.
и вот в следующем прииере
http://cvs.samba.org/cgi-bin/cvsweb/~checkout~/netfilter/testsuite/tools/intercept.c?rev=1.6&content-type=text/plain
у меня такой вывод strace:
execve("x86/o/pktmgr", ["x86/o/pktmgr", "LOCAL_IN", "DROP", "11", "11", "src=195.133.155.1"], [/* 34 vars */]) = 0
uname({sys="Linux", node="ant.metahood.ru", ...}) = 0
brk(0) = 0x804b1b4
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=66721, ...}) = 0
old_mmap(NULL, 66721, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40017000
close(4) = 0
open("/lib/i686/libc.so.6", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \306\1"..., 1024) = 1024
fstat64(4, {st_mode=S_IFREG|0755, st_size=5772268, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40028000
old_mmap(NULL, 1290088, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40029000
mprotect(0x4015b000, 36712, PROT_NONE) = 0
old_mmap(0x4015b000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x131000) = 0x4015b000
old_mmap(0x40160000, 16232, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40160000
close(4) = 0
munmap(0x40017000, 66721) = 0
brk(0) = 0x804b1b4
brk(0x804b1ec) = 0x804b1ec
brk(0x804c000) = 0x804c000
socket(PF_NETLINK, SOCK_RAW, 3) = 4
getpid() = 1228
bind(4, {sin_family=AF_NETLINK, {sa_family=16, sa_data="\0\0\314\4\0\0\0\0\0\0\0\0\0\0"}, 12) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
write(1, "ipq_create_handle OK\n", 21) = 21
sendto(4, ",\0\0\0\21\0\1\0\0\0\0\0\314\4\0\0\377\0\0\0\0\0\1\0\0"..., 44, 0, {sin_family=AF_NETLINK, {sa_family=16, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 12) = 44
write(1, "ipq_set_mode OK\n", 16) = 16
alarm(11) = 0
write(1, "to read\n", 8) = 8
recvfrom(4, "$\0\0\0\2\0\0\0\0\0\0\0\314\4\0\0\352\377\377\377,\0\0"..., 512, 0, {sin_family=AF_NETLINK, {sa_family=16, sa_data="\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, [12]) = 36
write(1, "read:36\n", 8) = 8
write(2, "Received error message 22 [Inval"..., 45Received error message 22 [Invalid argument]
) = 45
munmap(0x40017000, 4096) = 0
_exit(1) = ?
i.e. я читаю из netlink-socket-а, но netlink почему-то ложит в буффер статус ошибки.
Почему это происходит!?
C уважением
=vasa=