diff options
author | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-28 12:33:24 +0000 |
---|---|---|
committer | ludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-28 12:33:24 +0000 |
commit | f9f317367195d4b10bbdf9c12e5357e58c903f12 (patch) | |
tree | 8a0ba7ba359bb9670875d8de351f0f9fd78a3706 /code/unix | |
parent | 51bdc4949c46c6fd1d2ce1e1bf228f9df3b847b6 (diff) | |
download | ioquake3-aero-f9f317367195d4b10bbdf9c12e5357e58c903f12.tar.gz ioquake3-aero-f9f317367195d4b10bbdf9c12e5357e58c903f12.zip |
add checks for LAN IPs to prevent q3ded from trying to authenticate
private IPs
git-svn-id: svn://svn.icculus.org/quake3/trunk@16 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/unix')
-rwxr-xr-x | code/unix/unix_net.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/code/unix/unix_net.c b/code/unix/unix_net.c index 7130ddf..a7412c0 100755 --- a/code/unix/unix_net.c +++ b/code/unix/unix_net.c @@ -273,6 +273,19 @@ qboolean Sys_IsLANAddress (netadr_t adr) { return qfalse; } + // RFC1918: + // 10.0.0.0 - 10.255.255.255 (10/8 prefix) + // 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) + // 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) + if(adr.ip[0] == 10) + return qtrue; + if(adr.ip[0] == 172 && adr.ip[1]&0xf0 == 16) + return qtrue; + if(adr.ip[0] == 192 && adr.ip[1] == 168) + return qtrue; + + // the checks below are bogus, aren't they? -- ln + // choose which comparison to use based on the class of the address being tested // any local adresses of a different class than the address being tested will fail based on the first byte |