Browse Source

engine: network: fix IPv4 private address checks according to RFC1918

Thanks to @Mr0maks for the fix
pull/2/head
Alibek Omarov 2 years ago committed by GitHub
parent
commit
3e1db432df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      engine/common/net_ws.c

4
engine/common/net_ws.c

@ -616,7 +616,7 @@ qboolean NET_IsReservedAdr( netadr_t a ) @@ -616,7 +616,7 @@ qboolean NET_IsReservedAdr( netadr_t a )
if( a.type == NA_IP )
{
if( a.ip[0] == 10 || a.ip[0] == 127 )
if( a.ip[0] == 10 )
return true;
if( a.ip[0] == 172 && a.ip[1] >= 16 )
@ -626,7 +626,7 @@ qboolean NET_IsReservedAdr( netadr_t a ) @@ -626,7 +626,7 @@ qboolean NET_IsReservedAdr( netadr_t a )
return true;
}
if( a.ip[0] == 192 && a.ip[1] >= 168 )
if( a.ip[0] == 192 && a.ip[1] == 168 )
return true;
}

Loading…
Cancel
Save