summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-ipv4acd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-23 15:56:01 +0200
committerLennart Poettering <lennart@poettering.net>2016-05-26 15:34:41 +0200
commit004845d18ed31fe5ffc153699f63e58dc8b24171 (patch)
tree71d747cd4ba0b3b923819c9358ef0ea67e49b69b /src/libsystemd-network/sd-ipv4acd.c
parente81f2539673b536c1b20fe2fd0650079d71125a2 (diff)
sd-network: unify packet processing logic a bit
Let's always check for errno being EAGAIN/EINTR the same way, and always log if we receive weirdly short packets.
Diffstat (limited to 'src/libsystemd-network/sd-ipv4acd.c')
-rw-r--r--src/libsystemd-network/sd-ipv4acd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c
index c1f43c824b..3c9fa85198 100644
--- a/src/libsystemd-network/sd-ipv4acd.c
+++ b/src/libsystemd-network/sd-ipv4acd.c
@@ -366,6 +366,9 @@ static int ipv4acd_on_packet(
n = recv(fd, &packet, sizeof(struct ether_arp), 0);
if (n < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ return 0;
+
r = log_ipv4acd_debug_errno(ll, errno, "Failed to read ARP packet: %m");
goto out;
}