From 18fc4c931e75d8de804c601b46dc8c8b339db3d9 Mon Sep 17 00:00:00 2001 From: Darkelarious Date: Mon, 25 Sep 2017 22:41:59 +0200 Subject: game statistics for all servers, numerous small fixes --- lib/MasterServer/Core/Util.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/MasterServer/Core/Util.pm') diff --git a/lib/MasterServer/Core/Util.pm b/lib/MasterServer/Core/Util.pm index 5af8264..3ca009d 100755 --- a/lib/MasterServer/Core/Util.pm +++ b/lib/MasterServer/Core/Util.pm @@ -54,8 +54,8 @@ sub valid_address { my $val_addr = ($a =~ '^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$') if $a; my $val_port = ($p =~ m/^\d+$/ && 0 < $p && $p <= 65535) if $p; - # exclude addresses where we don't want people sniffing - for (qw|192.168.(.\d*).(.\d*) 127.0.(.\d*).(.\d*) 10.0.(.\d*).(.\d*)|){$val_addr = 0 if ($a =~ m/$_/)} + # exclude local addresses + if ($a =~ m/192.168.(\d).(\d)/ || $a =~ m/127.0.(\d).(\d)/ || $a =~ m/10.0.(\d).(\d)/) { $val_addr = 0; } # only return true if both are valid return ($val_addr && $val_port); -- cgit v1.2.3