Fix ip tree lookup on netmask content

This commit is contained in:
Reed Morrison
2018-06-05 19:26:37 -03:00
committed by Felipe Zimmerle
parent 202a15bea8
commit 95048d5fcf
2 changed files with 3 additions and 1 deletions

View File

@@ -755,7 +755,7 @@ TreeNode *CPTFindElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
return node;
}
if (memcmp(node->prefix->buffer, temp_data, bytes) == 0) {
if ((node->netmasks == NULL) && memcmp(node->prefix->buffer, temp_data, bytes) == 0) {
mask = SHIFT_LEFT_MASK(8 - ip_bitmask % 8);
if ((ip_bitmask % 8) == 0) {