containers / containers/netavark

RFE: firewall combine setup_network and setup_port_forward into one function

Open
#957 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
794
Forks
161
Avg merge
8d 17h
Merged PRs (30d)
3

Description

Splitting the logic into two separate functions just seems to make the code more complicated, looking at iptables where we mostly use different table that may have made more sense but if we consider the nftables driver this seems like the wrong choice.

For nftables we only need to dump the rules once yet because the code is split into two functions calls we end up dumping the ruleset twice which makes things slower than it needs to be.
https://github.com/containers/netavark/blob/ad066d449509da3e5d827df6c4805ff595fc760b/src/firewall/nft.rs#L94
https://github.com/containers/netavark/blob/ad066d449509da3e5d827df6c4805ff595fc760b/src/firewall/nft.rs#L548

The same goes for the teardown functions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.