summaryrefslogtreecommitdiffstats
path: root/source/lib/access.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/access.c')
-rw-r--r--source/lib/access.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source/lib/access.c b/source/lib/access.c
index 73b4d57e706..d61915f0b24 100644
--- a/source/lib/access.c
+++ b/source/lib/access.c
@@ -15,8 +15,6 @@ static char *sep = ", \t";
#define FAIL (-1)
-#define ALLONES ((uint32)0xFFFFFFFF)
-
/* masked_match - match address against netnumber/netmask */
static int masked_match(char *tok, char *slash, char *s)
{
@@ -29,14 +27,8 @@ static int masked_match(char *tok, char *slash, char *s)
*slash = 0;
net = interpret_addr(tok);
*slash = '/';
-
- if (strlen(slash + 1) > 2) {
- mask = interpret_addr(slash + 1);
- } else {
- mask = (uint32)((ALLONES >> atoi(slash + 1)) ^ ALLONES);
- }
-
- if (net == INADDR_NONE || mask == INADDR_NONE) {
+ if (net == INADDR_NONE ||
+ (mask = interpret_addr(slash + 1)) == INADDR_NONE) {
DEBUG(0,("access: bad net/mask access control: %s\n", tok));
return (False);
}