<div dir="ltr">I see this patch for EAGAIN on an interface going away did not make the babel-ss-merge branch apparently.  (for those new to this bug, see: <a href="http://lists.alioth.debian.org/pipermail/babel-users/2014-October/001777.html">http://lists.alioth.debian.org/pipermail/babel-users/2014-October/001777.html</a> for more details. )<br><br>No, I haven't had time to test this patch, nor have I come up with a better idea.<br><br>I am curious if there could be some other *more robust* means of detecting when an interface has gone away, and/or how dnsmasq was coping with this situation nowadays.<br><br>(I'd mentioned this problem on the endless homenet thread<br><br><a href="http://www.ietf.org/mail-archive/web/homenet/current/msg05156.html">http://www.ietf.org/mail-archive/web/homenet/current/msg05156.html</a><br><br>and, thought I'd check to see if it was mainlined!)<br><br>I certainly hate any possibility anywhere in routing code where a possibility for infinite loop existed. are there any checkers for such loops in the world?<br><br>On Wed, Oct 15, 2014 at 2:00 PM, Juliusz Chroboczek <<a href="mailto:jch@pps.univ-paris-diderot.fr">jch@pps.univ-paris-diderot.fr</a>> wrote:<br>> Dave,<br>><br>> I'm not going to have time to test this for a while.  In the meantime,<br>> here's a proposed patch, please let me know if you find the time to test<br>> it.<br>>have<br>> -- Juliusz<br>><br>> diff --git a/net.c b/net.c<br>> index 6f9728f..9b0b738 100644<br>> --- a/net.c<br>> +++ b/net.c<br>> @@ -141,7 +141,7 @@ babel_send(int s,<br>>  {<br>>      struct iovec iovec[2];<br>>      struct msghdr msg;<br>> -    int rc;<br>> +    int rc, count = 0;<br>><br>>      iovec[0].iov_base = (void*)buf1;<br>>      iovec[0].iov_len = buflen1;<br>> @@ -156,13 +156,18 @@ babel_send(int s,<br>>   again:<br>>      rc = sendmsg(s, &msg, 0);<br>>      if(rc < 0) {<br>> -        if(errno == EINTR)<br>> -            goto again;<br>> -        else if(errno == EAGAIN) {<br>> +        if(errno == EINTR) {<br>> +            count++;<br>> +            if(count < 1000)<br>> +                goto again;<br>> +        } else if(errno == EAGAIN) {<br>>              int rc2;<br>>              rc2 = wait_for_fd(1, s, 5);<br>> -            if(rc2 > 0)<br>> -                goto again;<br>> +            if(rc2 > 0) {<br>> +                count++;<br>> +                if(count < 1000)<br>> +                    goto again;<br>> +            }<br>>              errno = EAGAIN;<br>>          }<br>>      }<br><br><br><br>-- <br>Dave Täht<br>Let's make wifi fast, less jittery and reliable again!<br><br><a href="https://plus.google.com/u/0/107942175615993706558/posts/TVX3o84jjmb">https://plus.google.com/u/0/107942175615993706558/posts/TVX3o84jjmb</a></div>