dont allow strange ports in the beacon addr list

This commit is contained in:
Jeff Hill
2000-11-21 22:20:46 +00:00
parent 16d897ff93
commit 1052c6b2b7

View File

@@ -51,6 +51,23 @@
#include "server.h"
/*
* forcePort ()
*/
static void forcePort (ELLLIST *pList, unsigned short port)
{
osiSockAddrNode *pNode;
pNode = (osiSockAddrNode *) ellFirst ( pList );
while ( pNode ) {
if ( pNode->addr.sa.sa_family == AF_INET ) {
pNode->addr.ia.sin_port = htons (port);
}
pNode = (osiSockAddrNode *) ellNext ( &pNode->node );
}
}
/*
* RSRV_ONLINE_NOTIFY_TASK
*/
@@ -130,6 +147,9 @@ int rsrv_online_notify_task()
if ( ellCount ( &beaconAddrList ) == 0 ) {
errlogPrintf ("The CA server's beacon address list was empty after initialization?\n");
}
else {
forcePort ( &beaconAddrList, port );
}
# ifdef DEBUG
printChannelAccessAddressList (&beaconAddrList);