Index: avahi-core/socket.c =================================================================== --- avahi-core/socket.c (revision 1360) +++ avahi-core/socket.c (revision 1361) @@ -635,6 +635,9 @@ goto fail; } + if (ms <= 0) + goto fail; + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); io.iov_base = AVAHI_DNS_PACKET_DATA(p); @@ -650,7 +653,14 @@ msg.msg_flags = 0; if ((l = recvmsg(fd, &msg, 0)) < 0) { - avahi_log_warn("recvmsg(): %s", strerror(errno)); + /* Linux returns EAGAIN when an invalid IP packet has been + recieved. We suppress warnings in this case because this might + create quite a bit of log traffic on machines with unstable + links. (See #60) */ + + if (errno != EAGAIN) + avahi_log_warn("recvmsg(): %s", strerror(errno)); + goto fail; } @@ -768,6 +778,9 @@ avahi_log_warn("ioctl(): %s", strerror(errno)); goto fail; } + + if (ms <= 0) + goto fail; p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); @@ -785,7 +798,14 @@ msg.msg_flags = 0; if ((l = recvmsg(fd, &msg, 0)) < 0) { - avahi_log_warn("recvmsg(): %s", strerror(errno)); + /* Linux returns EAGAIN when an invalid IP packet has been + recieved. We suppress warnings in this case because this might + create quite a bit of log traffic on machines with unstable + links. (See #60) */ + + if (errno != EAGAIN) + avahi_log_warn("recvmsg(): %s", strerror(errno)); + goto fail; }