Changeset - r25481:a4b8d80e7cfa
[Not reviewed]
master
0 1 0
Rubidium - 3 years ago 2021-05-10 21:06:23
rubidium@openttd.org
Fix: [Network] Check on CIDR for netmask check considered everything valid
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/network/core/address.cpp
Show inline comments
 
@@ -170,7 +170,7 @@ bool NetworkAddress::IsInNetmask(const c
 
		int tmp_cidr = atoi(chr_cidr + 1);
 

	
 
		/* Invalid CIDR, treat as single host */
 
		if (tmp_cidr > 0 || tmp_cidr < cidr) cidr = tmp_cidr;
 
		if (tmp_cidr > 0 && tmp_cidr < cidr) cidr = tmp_cidr;
 

	
 
		/* Remove the / so that NetworkAddress works on the IP portion */
 
		std::string ip_str(netmask, chr_cidr - netmask);
0 comments (0 inline, 0 general)