net: accept large option length for SO_LINGER

* net.c (print_linger): Allow len > sizeof(struct linger) to match
the kernel behaviour.
This commit is contained in:
Дмитрий Левин 2017-07-08 14:57:44 +00:00
parent 6314e1d0f1
commit 2ccd886706

5
net.c
View File

@ -489,11 +489,12 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
}
static void
print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
print_linger(struct tcb *const tcp, const kernel_ulong_t addr,
const unsigned int len)
{
struct linger linger;
if (len != sizeof(linger) ||
if (len < sizeof(linger) ||
umove(tcp, addr, &linger) < 0) {
printaddr(addr);
return;