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

Thanks to @Mr0maks for the fix
This commit is contained in:
Alibek Omarov 2022-08-23 19:15:50 +03:00 committed by GitHub
parent 3c682507e7
commit 3e1db432df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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 )
return true;
}
if( a.ip[0] == 192 && a.ip[1] >= 168 )
if( a.ip[0] == 192 && a.ip[1] == 168 )
return true;
}