Skip to content

Commit 5c16c2d

Browse files
committed
Fix chain creation
1 parent 1b8e970 commit 5c16c2d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/schains/firewall/nftables.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434

3535
logger = logging.getLogger(__name__)
3636

37+
3738
TABLE = 'firewall'
38-
CHAIN = 'INPUT'
39+
CHAIN = 'skale'
3940

4041

4142
class NFTablesCmdFailedError(Exception):
@@ -48,7 +49,7 @@ class NFTablesController(IHostFirewallController):
4849

4950
def __init__(self, table: str = TABLE, chain: str = CHAIN) -> None:
5051
self.table = table
51-
self.chain = chain
52+
self.chain = f'skale-{chain}'
5253
self._nftables = importlib.import_module('nftables')
5354
self.nft = self._nftables.Nftables()
5455
self.nft.set_json_output(True)
@@ -95,7 +96,8 @@ def add_schain_drop_rule(self, first_port: int, last_port: int) -> None:
9596

9697
def create_chain(self, first_port: int, last_port: int) -> None:
9798
if not self.has_chain(self.chain):
98-
return self.run_json_cmd(
99+
logger.info('Creating chain %s', self.chain)
100+
self.run_json_cmd(
99101
self._compose_json(
100102
[
101103
{

0 commit comments

Comments
 (0)