1
0
mirror of https://passt.top/passt synced 2024-07-01 23:42:41 +00:00

pcap: Fix failure check on write() in pcapm()

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-21 17:36:05 +02:00
parent 73a4a6b7cd
commit 000ae818d4

3
pcap.c
View File

@ -118,7 +118,8 @@ void pcapm(struct msghdr *mh)
if (write(pcap_fd, &h, sizeof(h)) < 0)
goto fail;
if (write(pcap_fd, (char *)iov->iov_base + 4, iov->iov_len - 4))
if (write(pcap_fd, (char *)iov->iov_base + 4,
iov->iov_len - 4) < 0)
goto fail;
}