[client] Apply return traffic rules only if firewall is stateless (#3895)

This commit is contained in:
Viktor Liu
2025-06-02 12:11:54 +02:00
committed by GitHub
parent f16f0c7831
commit 41cd4952f1
7 changed files with 130 additions and 83 deletions

View File

@@ -326,6 +326,10 @@ func (m *Manager) IsServerRouteSupported() bool {
return true
}
func (m *Manager) IsStateful() bool {
return m.stateful
}
func (m *Manager) AddNatRule(pair firewall.RouterPair) error {
if m.nativeRouter.Load() && m.nativeFirewall != nil {
return m.nativeFirewall.AddNatRule(pair)
@@ -606,9 +610,8 @@ func (m *Manager) processOutgoingHooks(packetData []byte, size int) bool {
return true
}
if m.stateful {
m.trackOutbound(d, srcIP, dstIP, size)
}
// for netflow we keep track even if the firewall is stateless
m.trackOutbound(d, srcIP, dstIP, size)
return false
}