1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-26 10:03:40 +03:00

dhcp-server: port to recvmsg_safe()

Split out of #15457, let's see if this is the culprit of the CI failure.
This commit is contained in:
Lennart Poettering 2020-04-23 20:00:07 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 2adfd1bda1
commit 2efa5bc6fa

View File

@ -995,14 +995,12 @@ static int server_receive_message(sd_event_source *s, int fd,
iov = IOVEC_MAKE(message, buflen);
len = recvmsg(fd, &msg, 0);
if (len < 0) {
if (IN_SET(errno, EAGAIN, EINTR))
return 0;
return -errno;
}
if ((size_t)len < sizeof(DHCPMessage))
len = recvmsg_safe(fd, &msg, 0);
if (IN_SET(len, -EAGAIN, -EINTR))
return 0;
if (len < 0)
return len;
if ((size_t) len < sizeof(DHCPMessage))
return 0;
CMSG_FOREACH(cmsg, &msg) {