Skip to content

Commit 0af0316

Browse files
committed
Fix missing protocol in ruleID
1 parent 609a554 commit 0af0316

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/firewall/nftables/acl_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (m *AclManager) addIOFiltering(
239239
action firewall.Action,
240240
ipset *nftables.Set,
241241
) (*Rule, error) {
242-
ruleId := generatePeerRuleId(ip, sPort, dPort, action, ipset)
242+
ruleId := generatePeerRuleId(ip, proto, sPort, dPort, action, ipset)
243243
if r, ok := m.rules[ruleId]; ok {
244244
return &Rule{
245245
nftRule: r.nftRule,
@@ -686,8 +686,8 @@ func (m *AclManager) refreshRuleHandles(chain *nftables.Chain, mangle bool) erro
686686
return nil
687687
}
688688

689-
func generatePeerRuleId(ip net.IP, sPort *firewall.Port, dPort *firewall.Port, action firewall.Action, ipset *nftables.Set) string {
690-
rulesetID := ":"
689+
func generatePeerRuleId(ip net.IP, proto firewall.Protocol, sPort *firewall.Port, dPort *firewall.Port, action firewall.Action, ipset *nftables.Set) string {
690+
rulesetID := ":" + string(proto) + ":"
691691
if sPort != nil {
692692
rulesetID += sPort.String()
693693
}

0 commit comments

Comments
 (0)