Hardcoding names is ugly enough. Don't care about case.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 5 Dec 2007 19:07:02 +0000 (19:07 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 5 Dec 2007 19:07:02 +0000 (19:07 +0000)
net.py

diff --git a/net.py b/net.py
index b0874a6..088f9a3 100644 (file)
--- a/net.py
+++ b/net.py
@@ -89,14 +89,14 @@ def InitNAT(plc, data):
             continue
         # XXX arbitrary names
         for setting in settings:
-            if setting['category'] != 'firewall':
+            if setting['category'].upper() != 'FIREWALL':
                 continue
-            if setting['name'] == 'external':
+            if setting['name'].upper() == 'EXTERNAL':
                 # Enable NAT for this interface
                 ipt.add_ext(dev)
-            elif setting['name'] == 'internal':
+            elif setting['name'].upper() == 'INTERNAL':
                 ipt.add_int(dev)
-            elif setting['name'] == 'pf': # XXX Uglier code is hard to find...
+            elif setting['name'].upper() == 'PF': # XXX Uglier code is hard to find...
                 for pf in setting['value'].split("\n"):
                     fields = {}
                     for field in pf.split(","):