summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-04-26 16:18:39 +0000
committerGerald Carter <jerry@samba.org>2003-04-26 16:18:39 +0000
commit920958a392b41c23ecd4db3ca32ae90a2e09bff9 (patch)
tree346b12385698f8f9492de27d0b6f8228e5edffd3
parentff051e9cf4b468aa9fe7e3f84483571d3d2de556 (diff)
downloadsamba-920958a392b41c23ecd4db3ca32ae90a2e09bff9.tar.gz
round three of CIDR fixes; spotted by Tomoki AONO
-rw-r--r--source/lib/access.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/lib/access.c b/source/lib/access.c
index 9d07893c2f7..c30b3c33cc2 100644
--- a/source/lib/access.c
+++ b/source/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);
}