From 1da44eb8565687a3662b60e9f58ed5f508498282 Mon Sep 17 00:00:00 2001 From: dhewg Date: Wed, 4 Jul 2012 01:07:44 +0200 Subject: [PATCH] Fix Sys_IsLANAddress() on *nix Don't just convert the first char of the IP. LAN clients now get properly detected and don't need to auth against the master server. --- neo/sys/posix/posix_net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/sys/posix/posix_net.cpp b/neo/sys/posix/posix_net.cpp index 8b96cca9..b3bbdb54 100644 --- a/neo/sys/posix/posix_net.cpp +++ b/neo/sys/posix/posix_net.cpp @@ -230,7 +230,7 @@ bool Sys_IsLANAddress( const netadr_t adr ) { } for ( i = 0; i < num_interfaces; i++ ) { - ip = ntohl( adr.ip[0] ); + ip = ntohl( *( unsigned int *)&adr.ip ); if( ( netint[i].ip & netint[i].mask ) == ( ip & netint[i].mask ) ) { return true; }