|
@ -968,10 +968,17 @@ static int run_loop(n2n_sn_t * sss) { |
|
|
bread = recvfrom(sss->sock, pktbuf, N2N_SN_PKTBUF_SIZE, 0/*flags*/, |
|
|
bread = recvfrom(sss->sock, pktbuf, N2N_SN_PKTBUF_SIZE, 0/*flags*/, |
|
|
(struct sockaddr *)&sender_sock, (socklen_t*)&i); |
|
|
(struct sockaddr *)&sender_sock, (socklen_t*)&i); |
|
|
|
|
|
|
|
|
if(bread < 0) { |
|
|
if((bread < 0) |
|
|
|
|
|
#ifdef WIN32 |
|
|
|
|
|
&& (WSAGetLastError() != WSAECONNRESET) |
|
|
|
|
|
#endif |
|
|
|
|
|
) { |
|
|
/* For UDP bread of zero just means no data (unlike TCP). */ |
|
|
/* For UDP bread of zero just means no data (unlike TCP). */ |
|
|
/* The fd is no good now. Maybe we lost our interface. */ |
|
|
/* The fd is no good now. Maybe we lost our interface. */ |
|
|
traceEvent(TRACE_ERROR, "recvfrom() failed %d errno %d (%s)", bread, errno, strerror(errno)); |
|
|
traceEvent(TRACE_ERROR, "recvfrom() failed %d errno %d (%s)", bread, errno, strerror(errno)); |
|
|
|
|
|
#ifdef WIN32 |
|
|
|
|
|
traceEvent(TRACE_ERROR, "WSAGetLastError(): %u", WSAGetLastError()); |
|
|
|
|
|
#endif |
|
|
keep_running=0; |
|
|
keep_running=0; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|