From e82f3c4461bea78530003d7476bfe19e962521b4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 26 Apr 2003 16:18:39 +0000 Subject: round three of CIDR fixes; spotted by Tomoki AONO (This used to be commit 920958a392b41c23ecd4db3ca32ae90a2e09bff9) --- source3/lib/access.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/access.c b/source3/lib/access.c index 9d07893c2f..c30b3c33cc 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -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); } -- cgit