diff options
-rw-r--r-- | source3/lib/access.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); } |