mirrorlist-server/mirrorlist_server.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 2530807e1216786ea5dac8110cbb27a2f25103a3
Author: Adrian Reber <adrian(a)lisas.de>
Date: Sun May 16 17:15:22 2010 -0500
mirrorlist_server: handle bad client IP address input
Signed-off-by: Matt Domsch <matt(a)domsch.com>
diff --git a/mirrorlist-server/mirrorlist_server.py
b/mirrorlist-server/mirrorlist_server.py
index 0de7132..e909927 100755
--- a/mirrorlist-server/mirrorlist_server.py
+++ b/mirrorlist-server/mirrorlist_server.py
@@ -298,7 +298,10 @@ def do_internet2(kwargs, cache, clientCountry, header):
client_ip = kwargs['client_ip']
if client_ip == 'unknown':
return (header, hostresults)
- ip = IP(client_ip)
+ try:
+ ip = IP(client_ip)
+ except:
+ return (header, hostresults)
asn = lookup_ip_asn(internet2_tree, ip)
if asn is not None:
header += 'Using Internet2 '
@@ -312,7 +315,10 @@ def do_asn(kwargs, cache, header):
client_ip = kwargs['client_ip']
if client_ip == 'unknown':
return (header, hostresults)
- ip = IP(client_ip)
+ try:
+ ip = IP(client_ip)
+ except:
+ return (header, hostresults)
asn = lookup_ip_asn(global_tree, ip)
if asn is not None and asn in asn_host_cache:
for hostid in asn_host_cache[asn]:
Show replies by date