From 1c1722e19fdaece3cdb8a9e4268fb268cae7d06d Mon Sep 17 00:00:00 2001 From: Titoko Date: Mon, 4 Mar 2013 11:23:14 +0100 Subject: [PATCH] Check upnp before add rule in firewall.yml --- yunohost_firewall.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/yunohost_firewall.py b/yunohost_firewall.py index cb60a5d4..dfb66f98 100644 --- a/yunohost_firewall.py +++ b/yunohost_firewall.py @@ -32,6 +32,9 @@ def firewall_allow(protocol=None,port=None,ipv6=None,upnp=False): """ port=int(port) + if (upnp): + add_portmapping(protocol, upnp, ipv6) + if port<65536 and port>0: if protocol == "Both": update_yml(port,'TCP','a',ipv6) @@ -73,8 +76,6 @@ def firewall_disallow(protocol=None,port=None,ipv6=None,upnp=False): return firewall_reload(upnp) - - def firewall_list(): """ Allow port in iptables @@ -89,9 +90,6 @@ def firewall_list(): with open ('firewall.yml') as f: firewall = yaml.load(f) return firewall - - - def firewall_reload(upnp=False): ''' Reload iptables configuration