aboutgitcodebugslistschat
path: root/udp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-09-09 15:31:14 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-09-09 15:40:04 +0200
commit3994fc8f589aa44b1fecfcba223f9852e5a6064b (patch)
treee616de155bf376bf867c10b38e81c5dfc1325ca9 /udp.c
parentecf1f975641806755a6a1f3814bbee154f187d75 (diff)
downloadpasst-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar.gz
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar.bz2
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar.lz
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar.xz
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.tar.zst
passt-3994fc8f589aa44b1fecfcba223f9852e5a6064b.zip
udp: Reset iov_base after sending partial message on sendmmsg() failure
We set the length while processing messges, but the starting address is pre-initialised. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/udp.c b/udp.c
index 9feaa2b..fa40cd3 100644
--- a/udp.c
+++ b/udp.c
@@ -858,6 +858,8 @@ void udp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events,
cur_mh->msg_iov = &cur_mh->msg_iov[i];
sendmsg(c->fd_tap, cur_mh, MSG_NOSIGNAL);
+
+ *iov_base -= first_offset;
break;
}
}