Don't try to send MTU probes to unreachable nodes.
[oweals/tinc.git] / src / meta.c
index 76938276750573060cce2e70100b2f8b6b01c623..b59f15b09443f47596d8e60454686e262c5298b7 100644 (file)
@@ -41,6 +41,11 @@ bool send_meta(connection_t *c, const char *buffer, int length)
 
        cp();
 
+       if(!c) {
+               logger(LOG_ERR, _("send_meta() called with NULL pointer!"));
+               abort();
+       }
+
        ifdebug(META) logger(LOG_DEBUG, _("Sending %d bytes of metadata to %s (%s)"), length,
                           c->name, c->hostname);
 
@@ -94,10 +99,12 @@ bool flush_meta(connection_t *c)
                                                   c->name, c->hostname);
                        } else if(errno == EINTR) {
                                continue;
+#ifdef EWOULDBLOCK
                        } else if(errno == EWOULDBLOCK) {
                                ifdebug(CONNECTIONS) logger(LOG_DEBUG, _("Flushing %d bytes to %s (%s) would block"),
                                                c->outbuflen, c->name, c->hostname);
                                return true;
+#endif
                        } else {
                                logger(LOG_ERR, _("Flushing meta data to %s (%s) failed: %s"), c->name,
                                           c->hostname, strerror(errno));