Changes to avoid spurious ECONREFUSED returned from recvfrom() under linux

This commit is contained in:
Jeff Hill
1995-10-22 22:27:47 +00:00
parent 73a224a6ce
commit 7b03ab0182
2 changed files with 25 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
/************************************************************************/
/* $Id$ */
/* */
/* L O S A L A M O S */
/* Los Alamos National Laboratory */
@@ -45,6 +46,7 @@
/* 021794 joh turn on SO_REUSEADDR only after the test for */
/* address in use so that test works on UNIX */
/* kernels that support multicast */
/* $Log$ */
/* */
/*_begin */
/************************************************************************/
@@ -1044,6 +1046,16 @@ LOCAL void udp_recv_msg(struct ioc_in_use *piiu)
UNLOCK;
return;
}
# ifdef linux
/*
* Avoid spurious ECONNREFUSED bug
* in linux
*/
if (MYERRNO==ECONNREFUSED) {
UNLOCK;
return;
}
# endif
ca_printf("Unexpected UDP failure %s\n", strerror(MYERRNO));
}
else if(status > 0){

View File

@@ -1,4 +1,6 @@
/*
* $Id$
*
* REPEATER.C
*
* CA broadcast repeater
@@ -59,6 +61,8 @@
* .08 102993 joh toggle set sock opt to set
* .09 070195 joh discover client has vanished by connecting its
* datagram socket (and watching for ECONNREFUSED)
*
* $Log$
*/
static char *sccsId = "@(#)$Id$";
@@ -149,6 +153,15 @@ void ca_repeater()
&from_size);
if(size < 0){
# ifdef linux
/*
* Avoid spurious ECONNREFUSED bug
* in linux
*/
if (MYERRNO==ECONNREFUSED) {
continue;
}
# endif
ca_printf("CA Repeater: recv err %s\n",
strerror(MYERRNO));
continue;