Commit 1e4b2a46 authored by Valentin Samir's avatar Valentin Samir
Browse files

[firewall4] Oublis lors de la création de add_ports

parent 3a69230c
......@@ -852,7 +852,7 @@ class firewall_komaz(firewall_base_routeur):
port = '0%s' % port
return port
def add_ports(ip, proto, sens):
def add_ports(ip, machine, proto, sens):
self.add(
table,
chain,
......@@ -860,7 +860,7 @@ class firewall_komaz(firewall_base_routeur):
proto,
(sens=='out' and 's') or (sens == 'in' and 'd'),
ip,
','.join( format_port(port) for port in machine['portTCP%s' % sens])
','.join( format_port(port) for port in machine['port%s%s' % (proto.upper(), sens)])
)
)
......@@ -876,13 +876,13 @@ class firewall_komaz(firewall_base_routeur):
for machine in self.machines():
for ip in machine['ipHostNumber']:
if 'portTCPout' in machine.attrs.keys():
add_ports(ip,'tcp','out')
add_ports(ip, machine, 'tcp', 'out')
if 'portUDPout' in machine.attrs.keys():
add_ports(ip,'udp','out')
add_ports(ip, machine, 'udp', 'out')
if 'portTCPin' in machine.attrs.keys():
add_ports(ip,'tcp','in')
add_ports(ip, machine, 'tcp', 'in')
if 'portUDPin' in machine.attrs.keys():
add_ports(ip,'udp','in')
add_ports(ip, machine, 'udp', 'in')
self.add(table, chain, '-j REJECT')
print OK
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment