From 1052c6b2b79a30c1ebe7cf88cd4dbcd6f63c7766 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 21 Nov 2000 22:20:46 +0000 Subject: [PATCH] dont allow strange ports in the beacon addr list --- src/rsrv/online_notify.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/rsrv/online_notify.c b/src/rsrv/online_notify.c index a9dc78073..de8c66b8f 100644 --- a/src/rsrv/online_notify.c +++ b/src/rsrv/online_notify.c @@ -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);