summaryrefslogtreecommitdiffstats
path: root/source3/lib/access.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-04-26 16:18:20 +0000
committerGerald Carter <jerry@samba.org>2003-04-26 16:18:20 +0000
commitce9af4e049608038a4acb056271f0799741bf61d (patch)
treee4eac62b618a1718029d265f443424c2ceca4502 /source3/lib/access.c
parent38c0f29c9e1d5b1268ccf3e606775d9d293cc7ac (diff)
downloadsamba-ce9af4e049608038a4acb056271f0799741bf61d.tar.gz
samba-ce9af4e049608038a4acb056271f0799741bf61d.tar.xz
samba-ce9af4e049608038a4acb056271f0799741bf61d.zip
round three of CIDR fixes; spotted by Tomoki AONO
(This used to be commit 554026b2084e2371c1ddae7316fbb0b9b76472d4)
Diffstat (limited to 'source3/lib/access.c')
-rw-r--r--source3/lib/access.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/lib/access.c b/source3/lib/access.c
index 9d07893c2f7..c30b3c33cc2 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);
}