enable NETLINK_EXT_ACK extended error reporting
(we don't yet do anything with it, but at least in strace we should now see more detailed errors from the kernel) Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I6a34a0e7e866bbde41daef23870ad90dceee6ded
This commit is contained in:
parent
0b2781b5ec
commit
e8dceddeec
1 changed files with 6 additions and 0 deletions
|
|
@ -386,6 +386,12 @@ int sendAndProcessNetlinkResponse(const void *req, int len) {
|
|||
return -error;
|
||||
}
|
||||
|
||||
if (setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &on, sizeof(on))) {
|
||||
int error = errno;
|
||||
ALOGW("setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, 1): %d", error);
|
||||
// will fail on 4.9 kernels so don't: return -error;
|
||||
}
|
||||
|
||||
// this is needed to get valid strace netlink parsing, it allocates the pid
|
||||
if (bind(fd, (const struct sockaddr *)&KERNEL_NLADDR,
|
||||
sizeof(KERNEL_NLADDR))) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue