diff --git a/src/cas/io/bsdSocket/casDGIntfIO.cc b/src/cas/io/bsdSocket/casDGIntfIO.cc index c76fb3bc5..9fb2b07d3 100644 --- a/src/cas/io/bsdSocket/casDGIntfIO.cc +++ b/src/cas/io/bsdSocket/casDGIntfIO.cc @@ -454,9 +454,14 @@ void casDGIntfIO::sendBeaconIO ( char & msg, unsigned length, { // disconnect so that bogus messages arriving at the ephemeral port // do not consume resources + // + // UDP disconnect to INADDR_LOOPBACK and port 0 because + // a UDP connect to AF_UNSPEC only works with modern IP kernel osiSockAddr sockAddr; memset ( &sockAddr, 0, sizeof ( sockAddr ) ); - sockAddr.sa.sa_family = AF_UNSPEC; + sockAddr.ia.sin_family = AF_INET; + sockAddr.ia.sin_addr.s_addr = INADDR_LOOPBACK; + sockAddr.ia.sin_port = 0; status = connect ( this->beaconSock, & sockAddr.sa, sizeof ( sockAddr.sa ) ); if ( status < 0 ) { diff --git a/src/rsrv/online_notify.c b/src/rsrv/online_notify.c index 86fecdbe5..76ec06cad 100644 --- a/src/rsrv/online_notify.c +++ b/src/rsrv/online_notify.c @@ -268,7 +268,11 @@ void rsrv_online_notify_task(void *pParm) */ osiSockAddr sockAddr; memset ( &sockAddr, 0, sizeof ( sockAddr ) ); - sockAddr.sa.sa_family = AF_UNSPEC; + // connect to INADDR_LOOPBACK and port 0 because + // connect to AF_UNSPEC only works with modern IP kernel + sockAddr.ia.sin_family = AF_INET; + sockAddr.ia.sin_addr.s_addr = INADDR_LOOPBACK; + sockAddr.ia.sin_port = 0; status = connect ( sock, & sockAddr.sa, sizeof ( sockAddr.sa ) ); if ( status < 0 ) {