Dont set the local interfaces's address in the msg header

when sending a beacon because it is difficult to predict
which interface will be used
This commit is contained in:
Jeff Hill
1999-09-15 00:12:42 +00:00
parent 9bf9641d7f
commit bff25d93d2
2 changed files with 4 additions and 6 deletions

View File

@@ -167,7 +167,7 @@ casDGIntfIO::casDGIntfIO (caServerI &serverIn, const caNetAddr &addr,
// always fill in this interface's address as the reply
// address.
//
#if !defined(_WIN32) || 1
#if !defined(_WIN32)
if (serverAddr.sin_addr.s_addr != htonl(INADDR_ANY)) {
this->bcastRecvSock = casDGIntfIO::makeSockDG ();
@@ -337,7 +337,7 @@ bufSizeT casDGIntfIO::incommingBytesPresent () const
//
// casDGIntfIO::sendBeacon()
//
void casDGIntfIO::sendBeaconIO (char &msg, unsigned length, aitUint32 &m_ipa, aitUint16 &m_port)
void casDGIntfIO::sendBeaconIO (char &msg, unsigned length, aitUint16 &m_port)
{
caAddrNode *pAddr;
int status;
@@ -348,9 +348,7 @@ void casDGIntfIO::sendBeaconIO (char &msg, unsigned length, aitUint32 &m_ipa, ai
//
for (pAddr = (caAddrNode *)ellFirst(&this->beaconAddrList);
pAddr; pAddr = (caAddrNode *)ellNext(&pAddr->node)) {
m_ipa = pAddr->srcAddr.in.sin_addr.s_addr;
m_port = htons(this->dgPort);
m_port = htons (this->dgPort);
status = sendto (this->sock, &msg, length, 0,
&pAddr->destAddr.sa, sizeof(pAddr->destAddr.sa));
if (status < 0) {

View File

@@ -32,7 +32,7 @@ public:
bool validBCastFD () const;
void xSetNonBlocking ();
void sendBeaconIO (char &msg, bufSizeT length, aitUint32 &m_ipa, aitUint16 &m_port);
void sendBeaconIO (char &msg, bufSizeT length, aitUint16 &m_port);
casIOState state () const;
outBuf::flushCondition osdSend (const char *pBuf, bufSizeT nBytesReq,