diff options
author | Gerald Carter <jerry@samba.org> | 2003-04-26 16:18:39 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-04-26 16:18:39 +0000 |
commit | e82f3c4461bea78530003d7476bfe19e962521b4 (patch) | |
tree | 8dfb9fe2b0be76cdc68c8101018baa513ac9b81a /source3 | |
parent | fc955b8c18f8ac12cb98d333b33013670397cb9b (diff) | |
download | samba-e82f3c4461bea78530003d7476bfe19e962521b4.tar.gz samba-e82f3c4461bea78530003d7476bfe19e962521b4.tar.bz2 samba-e82f3c4461bea78530003d7476bfe19e962521b4.zip |
round three of CIDR fixes; spotted by Tomoki AONO
(This used to be commit 920958a392b41c23ecd4db3ca32ae90a2e09bff9)
Diffstat (limited to 'source3')
-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); } |