Handle setsockopt(SOL_SOCKET, SO_ATTACH_FILTER) better. Based

on patch from Guy Harris on BZ#318203.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13461
This commit is contained in:
Tom Hughes
2013-07-17 14:36:57 +00:00
parent 479650d938
commit 97342e80a6
3 changed files with 74 additions and 3 deletions

View File

@@ -680,8 +680,11 @@ __KINLINE struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, struct
#define VKI_MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
#define VKI_SOL_SOCKET 1
#define VKI_SOL_SCTP 132
#define VKI_SO_ATTACH_FILTER 26
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/in.h
//----------------------------------------------------------------------
@@ -3139,6 +3142,22 @@ struct vki_file_handle {
unsigned char f_handle[0];
};
//----------------------------------------------------------------------
// From linux-3.2.0/include/linux/filter.h
//----------------------------------------------------------------------
struct vki_sock_filter {
__vki_u16 code; /* Actual filter code */
__vki_u8 jt; /* Jump true */
__vki_u8 jf; /* Jump false */
__vki_u32 k; /* Generic multiuse field */
};
struct vki_sock_fprog {
__vki_u16 len; /* actually unsigned short */
struct vki_sock_filter *filter;
};
#endif // __VKI_LINUX_H
/*--------------------------------------------------------------------*/