rsrv: fix wildcard check ordering

filter out mcast addresses before wildcard uniqueness check.
This commit is contained in:
Michael Davidsaver
2016-01-23 13:53:44 -05:00
parent eb9246e4c9
commit b961b25151
+8 -6
View File
@@ -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) {