net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK
Tweak the parser to follow the kernel behaviour. * net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and print returned value as integer iff the length is >= sizeof(int), otherwise print the address. * NEWS: Mention this.
This commit is contained in:
parent
15f502c78a
commit
8a7030f20a
4
NEWS
4
NEWS
@ -3,8 +3,8 @@ Noteworthy changes in release ?.?? (????-??-??)
|
||||
|
||||
* Improvements
|
||||
* Implemented decoding of netlink descriptor attributes as file descriptors.
|
||||
* Implemented decoding of option name argument of getsockopt and setsockopt
|
||||
syscalls for SOL_NETLINK level.
|
||||
* Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
|
||||
level.
|
||||
* Updated the list of MSG_* constants.
|
||||
|
||||
Noteworthy changes in release 4.20 (2017-11-13)
|
||||
|
14
net.c
14
net.c
@ -601,6 +601,13 @@ print_getsockopt(struct tcb *const tcp, const unsigned int level,
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case SOL_NETLINK:
|
||||
if (len < (int) sizeof(int))
|
||||
printaddr(addr); /* unlikely */
|
||||
else
|
||||
printnum_int(tcp, addr, "%d");
|
||||
return;
|
||||
}
|
||||
|
||||
/* default arg printing */
|
||||
@ -825,6 +832,13 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level,
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case SOL_NETLINK:
|
||||
if (len < (int) sizeof(int))
|
||||
printaddr(addr);
|
||||
else
|
||||
printnum_int(tcp, addr, "%d");
|
||||
return;
|
||||
}
|
||||
|
||||
/* default arg printing */
|
||||
|
Loading…
x
Reference in New Issue
Block a user