Do not log errors when recvfrom() returns EAGAIN or EINTR.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 11 Jun 2009 17:26:34 +0000 (19:26 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 11 Jun 2009 17:26:34 +0000 (19:26 +0200)
Although we select() before we call recvfrom(), it sometimes happens that
select() tells us we can read but a subsequent read fails anyway. This is
harmless.

src/net_packet.c

index 9f61275..5e503f5 100644 (file)
@@ -552,7 +552,8 @@ void handle_incoming_vpn_data(int sock)
        pkt.len = recvfrom(sock, (char *) &pkt.seqno, MAXSIZE, 0, &from.sa, &fromlen);
 
        if(pkt.len < 0) {
-               logger(LOG_ERR, _("Receiving packet failed: %s"), strerror(errno));
+               if(errno != EAGAIN && errno != EINTR)
+                       logger(LOG_ERR, _("Receiving packet failed: %s"), strerror(errno));
                return;
        }