# HG changeset patch # User Branko Majic # Date 2013-06-23 22:50:26 # Node ID adb80c4c58a5f1051b9c6424ce3ed4a515d300b0 # Parent f4bb5c3c3539a89c6d8a7b4cc116c38d7ccd9806 Fixed the checking and rendering of protocol in a rule. diff --git a/conntrackt/iptables.py b/conntrackt/iptables.py --- a/conntrackt/iptables.py +++ b/conntrackt/iptables.py @@ -31,12 +31,12 @@ class Rule(object): produce comments in the output. """ - if protocol not in ("TCP", "UDP", "ICMP"): + if protocol.upper() not in ("TCP", "UDP", "ICMP"): raise ValueError("Unsupported protocol specified: %s" % protocol) self.source = source self.destination = destination - self.protocol = protocol + self.protocol = protocol.lower() self.port = port self.description = description