1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

round three of CIDR fixes; spotted by Tomoki AONO

This commit is contained in:
Gerald Carter -
parent 2a99e77e91
commit 554026b208

View File

@ -34,6 +34,8 @@ static BOOL masked_match(const char *tok, const char *slash, const char *s)
mask = interpret_addr(slash + 1);
} else {
mask = (uint32)((ALLONES >> atoi(slash + 1)) ^ ALLONES);
/* convert to network byte order */
mask = htonl(mask);
}
if (net == INADDR_NONE || mask == INADDR_NONE) {
@ -41,9 +43,6 @@ static BOOL masked_match(const char *tok, const char *slash, const char *s)
return (False);
}
/* convert to network byte order */
mask = htonl(mask);
return ((addr & mask) == net);
}