From 3e1db432df0087b48a32f6e6e77a902916d11218 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 23 Aug 2022 19:15:50 +0300 Subject: [PATCH] engine: network: fix IPv4 private address checks according to RFC1918 Thanks to @Mr0maks for the fix --- engine/common/net_ws.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/common/net_ws.c b/engine/common/net_ws.c index 999fb705..8f558881 100644 --- a/engine/common/net_ws.c +++ b/engine/common/net_ws.c @@ -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; }