aboutgitcodebugslistschat
path: root/pcap.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-21 17:36:05 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-21 17:36:05 +0200
commit000ae818d4e97b14fbf7fd83433db6df1de48e31 (patch)
tree2ac18992e219c8a44cb00355907b7c2b149fc53c /pcap.c
parent73a4a6b7cd4570f77c8ebb1cf6808b13d62b4db0 (diff)
downloadpasst-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar.gz
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar.bz2
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar.lz
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar.xz
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.tar.zst
passt-000ae818d4e97b14fbf7fd83433db6df1de48e31.zip
pcap: Fix failure check on write() in pcapm()
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pcap.c b/pcap.c
index 7b5a1af..0c61cd8 100644
--- a/pcap.c
+++ b/pcap.c
@@ -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;
}