From 762ffacc8e257cf46c8447c945ccc72b3f397d85 Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Sat, 10 Oct 2020 10:45:12 -0500 Subject: [PATCH] Bug#72 reading zero bytes in linux BIP. Thanks, Mikhail! (#132) Co-authored-by: Steve Karg --- ports/linux/bip-init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/linux/bip-init.c b/ports/linux/bip-init.c index ab284f6f..80811fad 100644 --- a/ports/linux/bip-init.c +++ b/ports/linux/bip-init.c @@ -516,6 +516,10 @@ static int readNlSock( perror("SOCK READ: "); return -1; } + if (readLen == 0) { + /* no data in the response */ + break; + } nlHdr = (struct nlmsghdr *)bufPtr; /* Check if the header is valid */ if ((0 == NLMSG_OK(nlHdr, readLen)) ||