From 3994fc8f589aa44b1fecfcba223f9852e5a6064b Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 9 Sep 2021 15:31:14 +0200 Subject: 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 --- udp.c | 2 ++ 1 file changed, 2 insertions(+) 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; } } -- cgit v1.2.3