summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Firewall.hs
diff options
context:
space:
mode:
authorFĂ©lix Sipma2016-03-07 14:29:07 +0100
committerJoey Hess2016-03-07 16:31:52 -0400
commit85e58f49ca676a3cfb34c6bfb27bb5d0b39e83f4 (patch)
tree4c679447a9ba78feb48cde256cd646941279c15c /src/Propellor/Property/Firewall.hs
parent9003983998e50f11e85e7f29e3eae3c486c0f6d0 (diff)
add fromPort function
(cherry picked from commit c3a23f89092d1ef8367c37ab8993ea7031124f4b)
Diffstat (limited to 'src/Propellor/Property/Firewall.hs')
-rw-r--r--src/Propellor/Property/Firewall.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs
index cb0f0b64..ec814c37 100644
--- a/src/Propellor/Property/Firewall.hs
+++ b/src/Propellor/Property/Firewall.hs
@@ -51,9 +51,9 @@ toIpTable r = map Param $
toIpTableArg :: Rules -> [String]
toIpTableArg Everything = []
toIpTableArg (Proto proto) = ["-p", map toLower $ show proto]
-toIpTableArg (DPort (Port port)) = ["--dport", show port]
-toIpTableArg (DPortRange (Port f, Port t)) =
- ["--dport", show f ++ ":" ++ show t]
+toIpTableArg (DPort port) = ["--dport", fromPort port]
+toIpTableArg (DPortRange (portf, portt)) =
+ ["--dport", fromPort portf ++ ":" ++ fromPort portt]
toIpTableArg (InIFace iface) = ["-i", iface]
toIpTableArg (OutIFace iface) = ["-o", iface]
toIpTableArg (Ctstate states) =
@@ -167,7 +167,7 @@ data Rules
-- ^There is actually some order dependency between proto and port so this should be a specific
-- data type with proto + ports
| DPort Port
- | DPortRange (Port,Port)
+ | DPortRange (Port, Port)
| InIFace Network.Interface
| OutIFace Network.Interface
| Ctstate [ ConnectionState ]