Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eterban
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eterban
Commits
1f316bfa
Commit
1f316bfa
authored
Jul 21, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gateway: fail safely on ipset setup errors
parent
e2d5d93c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
eterban_switcher.py
gateway/usr/share/eterban/eterban_switcher.py
+9
-5
No files found.
gateway/usr/share/eterban/eterban_switcher.py
View file @
1f316bfa
...
...
@@ -212,7 +212,7 @@ def create_iptables_rules():
[
'ipset'
,
'create'
,
ipset_firehol
,
'hash:net'
],
[
'ipset'
,
'create'
,
ipset_eterban_white
,
'hash:net'
]]
for
command
in
commands
:
subprocess
.
call
(
command
)
subprocess
.
run
(
command
+
[
'-exist'
],
check
=
True
,
timeout
=
10
)
# Per-WAN-interface rules
for
iface
in
wan_ifaces
:
...
...
@@ -242,7 +242,7 @@ def create_ip6tables_rules():
commands
=
[[
'ipset'
,
'create'
,
ipset_eterban_1_ipv6
,
'hash:ip'
,
'family'
,
'inet6'
,
'maxelem'
,
str
(
maxelem
)],
[
'ipset'
,
'create'
,
ipset_eterban_white_ipv6
,
'hash:net'
,
'family'
,
'inet6'
]]
for
command
in
commands
:
subprocess
.
call
(
command
)
subprocess
.
run
(
command
+
[
'-exist'
],
check
=
True
,
timeout
=
10
)
# Per-WAN-interface rules
for
iface
in
wan_ifaces
:
...
...
@@ -563,9 +563,13 @@ if auto_mgr.enabled:
# Older releases also kept the FireHOL set in this snapshot. The manual ban
# sets are flushed below and rebuilt from Redis, so the snapshot is only a
# migration source for them.
restore_legacy_ipsets
()
create_iptables_rules
()
create_ip6tables_rules
()
try
:
restore_legacy_ipsets
()
create_iptables_rules
()
create_ip6tables_rules
()
except
(
OSError
,
subprocess
.
SubprocessError
)
as
error
:
log_redis_error
(
"Unable to initialize firewall state: "
+
str
(
error
))
sys
.
exit
(
1
)
initialize_ban_state
()
restore_bans_from_redis
()
load_whitelist
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment