-
-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[client] Add userspace firewall stats #3104
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
flow.BytesOut.Add(bytes) | ||
flow.PacketsOut.Add(1) | ||
} | ||
flow.LastSeen = time.Now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LastSeen is not atomic. Is it a good thing to write under RLock?
m.udpTracker.TrackOutbound(srcIP, dstIP, | ||
uint16(d.udp.SrcPort), | ||
uint16(d.udp.DstPort), | ||
packetData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you pass the full packetData if you need to the length of it only? Same with ICMP.
@@ -84,6 +90,7 @@ func CreateWithNativeFirewall(iface IFaceMapper, nativeFirewall firewall.Manager | |||
|
|||
func create(iface IFaceMapper) (*Manager, error) { | |||
disableConntrack, _ := strconv.ParseBool(os.Getenv(EnvDisableConntrack)) | |||
enableStats, _ := strconv.ParseBool(os.Getenv(EnvEnableStats)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a warn message would be user-friendly in the case of typo.
@@ -52,6 +55,9 @@ type Manager struct { | |||
udpTracker *conntrack.UDPTracker | |||
icmpTracker *conntrack.ICMPTracker | |||
tcpTracker *conntrack.TCPTracker | |||
|
|||
statsEnabled bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks unused variable
Describe your changes
Issue ticket number and link
Checklist