diff options
author | shennetsind <ind@henn.et> | 2013-02-18 00:30:28 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-02-18 00:30:28 -0300 |
commit | 7e72f0cee8867837be53cb2119b610b00e9bd587 (patch) | |
tree | 22ab404109fb2def22cf0085fcec2bf174210970 /src/common/socket.c | |
parent | 237d76e7c409251b5fdb9f3eee40ef3fe5dc2b25 (diff) | |
download | hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.gz hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.bz2 hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.tar.xz hercules-7e72f0cee8867837be53cb2119b610b00e9bd587.zip |
Improvements all over the place
Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95!
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/socket.c')
-rw-r--r-- | src/common/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index 6977d4257..72633cf2b 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1017,14 +1017,14 @@ int access_ipmask(const char* str, AccessControl* acc) { uint32 ip; uint32 mask; - unsigned int a[4]; - unsigned int m[4]; - int n; if( strcmp(str,"all") == 0 ) { ip = 0; mask = 0; } else { + unsigned int a[4]; + unsigned int m[4]; + int n; if( ((n=sscanf(str,"%u.%u.%u.%u/%u.%u.%u.%u",a,a+1,a+2,a+3,m,m+1,m+2,m+3)) != 8 && // not an ip + standard mask (n=sscanf(str,"%u.%u.%u.%u/%u",a,a+1,a+2,a+3,m)) != 5 && // not an ip + bit mask (n=sscanf(str,"%u.%u.%u.%u",a,a+1,a+2,a+3)) != 4 ) || // not an ip |