From b961b25151d04e6d1cbb9857b9669d63b4d78271 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 23 Jan 2016 13:53:44 -0500 Subject: [PATCH] rsrv: fix wildcard check ordering filter out mcast addresses before wildcard uniqueness check. --- src/ioc/rsrv/caservertask.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ioc/rsrv/caservertask.c b/src/ioc/rsrv/caservertask.c index b90173c99..7fbd73016 100644 --- a/src/ioc/rsrv/caservertask.c +++ b/src/ioc/rsrv/caservertask.c @@ -303,7 +303,7 @@ void rsrv_build_addr_lists(void) } { - /* check user provided list */ + int foundWildcard = 0; osiSockAddrNode *pNode, *pNext; for(pNode = (osiSockAddrNode*)ellFirst(&casIntfAddrList), pNext = pNode ? (osiSockAddrNode*)ellNext(&pNode->node) : NULL; @@ -315,11 +315,7 @@ void rsrv_build_addr_lists(void) if(pNode->addr.ia.sin_family==AF_INET && pNode->addr.ia.sin_addr.s_addr==htonl(INADDR_ANY)) { - if (ellCount(&casIntfAddrList) != 1) { - fprintf(stderr, "CAS address list can not contain 0.0.0.0 and other addresses, ignoring...\n"); - ellDelete(&casIntfAddrList, &pNode->node); - free(pNode); - } + foundWildcard = 1; } else if(pNode->addr.ia.sin_family==AF_INET && top>=224 && top<=239) { /* This is a multi-cast address */ @@ -327,6 +323,12 @@ void rsrv_build_addr_lists(void) ellAdd(&casMCastAddrList, &pNode->node); } } + + if (foundWildcard && ellCount(&casIntfAddrList) != 1) { + fprintf(stderr, "CAS address list can not contain 0.0.0.0 and other addresses, ignoring...\n"); + ellDelete(&casIntfAddrList, &pNode->node); + free(pNode); + } } if (ellCount(&casIntfAddrList) == 0) {