mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
sd-rtnl: recv_message - drop message when peeking fails
Read the message form the socket or we will loop trying to read the same message repeatedly.
This commit is contained in:
parent
0b2bbbdf2f
commit
c7460cce79
@ -1377,9 +1377,17 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
|
||||
}
|
||||
}
|
||||
|
||||
if (!auth)
|
||||
if (!auth) {
|
||||
/* not from the kernel, ignore */
|
||||
if (peek) {
|
||||
/* drop the message */
|
||||
r = recvmsg(fd, &msg, 0);
|
||||
if (r < 0)
|
||||
return (errno == EAGAIN || errno == EINTR) ? 0 : -errno;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (group)
|
||||
*_group = group;
|
||||
|
Loading…
Reference in New Issue
Block a user