From 4c3099bb6c186786858887730b896c6b96415b2a Mon Sep 17 00:00:00 2001 From: ai4rei Date: Fri, 28 Jan 2011 01:38:33 +0000 Subject: * Resolving allow/deny IP rules not working (bugreport:2632). - Fixed 'mask' being filled with 'ip' when standard mask was specified (since r9647). - Fixed 'ip' and 'mask' (bit mask) being stored in wrong byte order (network order instead of host order) (since r10162). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14683 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/socket.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common/socket.c') diff --git a/src/common/socket.c b/src/common/socket.c index 89c605c9d..ff667cf2e 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -996,10 +996,10 @@ int access_ipmask(const char* str, AccessControl* acc) (n == 5 && m[0] > 32) ){ // invalid bit mask return 0; } - ip = (uint32)(a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)); + ip = MAKEIP(a[0],a[1],a[2],a[3]); if( n == 8 ) {// standard mask - mask = (uint32)(a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)); + mask = MAKEIP(m[0],m[1],m[2],m[3]); } else if( n == 5 ) {// bit mask mask = 0; @@ -1007,7 +1007,6 @@ int access_ipmask(const char* str, AccessControl* acc) mask = (mask >> 1) | 0x80000000; --m[0]; } - mask = ntohl(mask); } else {// just this ip mask = 0xFFFFFFFF; -- cgit v1.2.3-70-g09d2