Change unix_diag requests back to use full dump instead of exact match
Unfortunately, 64-bit linux kernel has a bug in matching inode numbers
greater than INT_MAX, so unix_diag exact match is not reliable.
This partially reverts commit 69bfc89770
.
* socketutils.c (unix_send_query): Add NLM_F_DUMP to nlmsg_flags,
remove initialization of udiag_cookie.
* tests/netlink_unix_diag.c (send_query): Remove "inode" argument,
add NLM_F_DUMP to nlmsg_flags, remove initialization of udiag_ino
and udiag_cookie.
(check_responses): Remove "inode" argument and its use.
(main): Remove invocation of inode_of_sockfd and passing of listening
socket inode to send_query and check_responses.
This commit is contained in:
@@ -242,14 +242,13 @@ unix_send_query(const int fd, const unsigned long inode)
|
||||
.nlh = {
|
||||
.nlmsg_len = sizeof(req),
|
||||
.nlmsg_type = SOCK_DIAG_BY_FAMILY,
|
||||
.nlmsg_flags = NLM_F_REQUEST
|
||||
.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST
|
||||
},
|
||||
.udr = {
|
||||
.sdiag_family = AF_UNIX,
|
||||
.udiag_ino = inode,
|
||||
.udiag_states = -1,
|
||||
.udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER,
|
||||
.udiag_cookie = { ~0U, ~0U }
|
||||
.udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER
|
||||
}
|
||||
};
|
||||
struct iovec iov = {
|
||||
|
Reference in New Issue
Block a user