diff --git a/src/vde_switch/datasock.c b/src/vde_switch/datasock.c index 1910fb1..be655e7 100644 --- a/src/vde_switch/datasock.c +++ b/src/vde_switch/datasock.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -87,8 +88,14 @@ union request { static int send_datasock(int fd_ctl, int fd_data, void *packet, int len, int port) { - if (send(fd_data, packet, len, 0) < 0) { + while (send(fd_data, packet, len, 0) < 0) { int rv=errno; +#if defined(VDE_DARWIN) || defined(VDE_FREEBSD) + if(rv == ENOBUFS) { + sched_yield(); + continue; + } +#endif if(rv != EAGAIN && rv != EWOULDBLOCK) printlog(LOG_WARNING,"send_sockaddr port %d: %s",port,strerror(errno)); else