[or-cvs] [metrics-utils/master 1/2] Fix parsing bug in exonerator.py, too.
karsten at torproject.org
karsten at torproject.org
Fri Nov 12 19:06:42 UTC 2010
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Fri, 12 Nov 2010 19:58:53 +0100
Subject: Fix parsing bug in exonerator.py, too.
Commit: 4571b24ee421770326aeea4b6936b4a6f4ae82e0
---
exonerator/exonerator.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/exonerator/exonerator.py b/exonerator/exonerator.py
index 641d65e..22b8335 100755
--- a/exonerator/exonerator.py
+++ b/exonerator/exonerator.py
@@ -264,6 +264,16 @@ if __name__ == '__main__':
line = descriptorFile.readline()
continue
if targetPort and rulePort != "*" and \
+ rulePort.find("-") > -1:
+ fromPort = int(rulePort.split("-")[0])
+ toPort = int(rulePort.split("-")[1])
+ if int(targetPort) < fromPort or \
+ int(targetPort) > toPort:
+ # port not contained in interval
+ line = descriptorFile.readline()
+ continue
+ if targetPort and rulePort != "*" and \
+ rulePort.find("-") == -1 and \
targetPort != rulePort:
# ports do not match
line = descriptorFile.readline()
--
1.7.1
More information about the tor-commits
mailing list