INADD_NONE:<repeater port> based UDP "disconnect"

This commit is contained in:
Jeff Hill
2005-11-07 17:35:39 +00:00
parent 77a023dc39
commit f4acd859cc
+6 -6
View File
@@ -453,16 +453,16 @@ void casDGIntfIO::sendBeaconIO ( char & msg, unsigned length,
}
{
// disconnect so that bogus messages arriving at the ephemeral port
// do not consume resources
// Connect to INADDR_NONE because a UDP connect to AF_UNSPEC
// only works with modern IP kernel.
//
// UDP disconnect to INADDR_LOOPBACK and port 0 because
// a UDP connect to AF_UNSPEC only works with modern IP kernel
// INADDR_NONE can never be a source address and therefore no
// messages can be received.
osiSockAddr sockAddr;
memset ( &sockAddr, 0, sizeof ( sockAddr ) );
sockAddr.ia.sin_family = AF_INET;
sockAddr.ia.sin_addr.s_addr = INADDR_LOOPBACK;
sockAddr.ia.sin_port = 0;
sockAddr.ia.sin_addr.s_addr = INADDR_NONE;
sockAddr.ia.sin_port = htons ( CA_REPEATER_PORT );
status = connect ( this->beaconSock,
& sockAddr.sa, sizeof ( sockAddr.sa ) );
if ( status < 0 ) {