From 2bf9959e1111a9cee258f5f0e4db46ced945dfd0 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 19 Sep 2008 23:27:52 +0000 Subject: [PATCH] committed a fix for mantis 302 --- src/ca/addrList.h | 3 ++- src/ca/iocinf.cpp | 9 +++++++-- src/cas/io/bsdSocket/casDGIntfIO.cc | 4 ++-- src/rsrv/online_notify.c | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ca/addrList.h b/src/ca/addrList.h index 868dd0b7b..6e50fb3f6 100644 --- a/src/ca/addrList.h +++ b/src/ca/addrList.h @@ -23,7 +23,8 @@ epicsShareFunc void epicsShareAPI configureChannelAccessAddressList ( struct ELLLIST *pList, SOCKET sock, unsigned short port ); epicsShareFunc void epicsShareAPI addAddrToChannelAccessAddressList - ( struct ELLLIST *pList, const ENV_PARAM *pEnv, unsigned short port ); + ( struct ELLLIST *pList, const ENV_PARAM *pEnv, + unsigned short port, int ignoreNonDefaultPort ); epicsShareFunc void epicsShareAPI printChannelAccessAddressList ( const struct ELLLIST *pList ); diff --git a/src/ca/iocinf.cpp b/src/ca/iocinf.cpp index 94b3337fc..a82bb0bf2 100644 --- a/src/ca/iocinf.cpp +++ b/src/ca/iocinf.cpp @@ -74,7 +74,8 @@ static char *getToken ( const char **ppString, char *pBuf, unsigned bufSIze ) * addAddrToChannelAccessAddressList () */ extern "C" void epicsShareAPI addAddrToChannelAccessAddressList - ( ELLLIST *pList, const ENV_PARAM *pEnv, unsigned short port ) + ( ELLLIST *pList, const ENV_PARAM *pEnv, + unsigned short port, int ignoreNonDefaultPort ) { osiSockAddrNode *pNewNode; const char *pStr; @@ -96,6 +97,10 @@ extern "C" void epicsShareAPI addAddrToChannelAccessAddressList continue; } + if ( ignoreNonDefaultPort && addr.sin_port != port ) { + continue; + } + pNewNode = (osiSockAddrNode *) calloc (1, sizeof(*pNewNode)); if (pNewNode==NULL) { fprintf ( stderr, "addAddrToChannelAccessAddressList(): no memory available for configuration\n"); @@ -235,7 +240,7 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList } } } - addAddrToChannelAccessAddressList ( &tmpList, &EPICS_CA_ADDR_LIST, port ); + addAddrToChannelAccessAddressList ( &tmpList, &EPICS_CA_ADDR_LIST, port, FALSE ); removeDuplicateAddresses ( pList, &tmpList, 0 ); } diff --git a/src/cas/io/bsdSocket/casDGIntfIO.cc b/src/cas/io/bsdSocket/casDGIntfIO.cc index 1d12745f5..476c6d6de 100644 --- a/src/cas/io/bsdSocket/casDGIntfIO.cc +++ b/src/cas/io/bsdSocket/casDGIntfIO.cc @@ -167,7 +167,7 @@ casDGIntfIO::casDGIntfIO ( caServerI & serverIn, clientBufMemoryManager & memMgr // add in the configured addresses // addAddrToChannelAccessAddressList ( - & BCastAddrList, pParam, beaconPort ); + & BCastAddrList, pParam, beaconPort, pParam == & EPICS_CA_ADDR_LIST ); } removeDuplicateAddresses ( & this->beaconAddrList, & BCastAddrList, 0 ); @@ -177,7 +177,7 @@ casDGIntfIO::casDGIntfIO ( caServerI & serverIn, clientBufMemoryManager & memMgr ellInit ( & parsed ); ellInit ( & filtered ); // we dont care what port they are coming from - addAddrToChannelAccessAddressList ( & parsed, & EPICS_CAS_IGNORE_ADDR_LIST, 0 ); + addAddrToChannelAccessAddressList ( & parsed, & EPICS_CAS_IGNORE_ADDR_LIST, 0, false ); removeDuplicateAddresses ( & filtered, & parsed, true ); while ( ELLNODE * pRawNode = ellGet ( & filtered ) ) { diff --git a/src/rsrv/online_notify.c b/src/rsrv/online_notify.c index c8c9636e9..828f50358 100644 --- a/src/rsrv/online_notify.c +++ b/src/rsrv/online_notify.c @@ -205,7 +205,7 @@ void rsrv_online_notify_task(void *pParm) * add in the configured addresses */ addAddrToChannelAccessAddressList ( - &autoAddrList, pParam, port); + &autoAddrList, pParam, port, pParam == &EPICS_CA_ADDR_LIST ); } removeDuplicateAddresses ( &beaconAddrList, &autoAddrList, 0 );