Skip to content

Commit

Permalink
fix(firewall): fixing duplicate creation of ipsets
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Nov 12, 2024
1 parent 1c3870e commit 3e1cfa6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/nethsec/firewall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1947,9 +1947,11 @@ def update_redirect_rules(uci):
except:
pass
else:
uci.set('firewall', section, 'ipset', f"{id}_ipset")
# create a full ipset configuration for the redirect rule
name = utils.get_random_id()
uci.set('firewall', section, 'ipset', f"{name}_ipset")
uci.set('firewall', f"{section}_ipset", "ipset")
uci.set('firewall', f"{section}_ipset", "name", f"{id}_ipset")
uci.set('firewall', f"{section}_ipset", "name", f"{name}_ipset")
uci.set('firewall', f"{section}_ipset", "match", "src_net")
uci.set('firewall', f"{section}_ipset", "enabled", "1")
uci.set('firewall', f"{section}_ipset", "entry", objects.get_object_ips(uci, ns_src))
Expand Down

0 comments on commit 3e1cfa6

Please sign in to comment.