Skip to content

Commit 994a469

Browse files
authored
Merge pull request kubernetes#130032 from aroradaman/conntrack-memory-leak-fix
Conntrack memory leak fix
2 parents 20b12ad + 6971779 commit 994a469

35 files changed

+685
-220
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ require (
6060
github.com/spf13/cobra v1.8.1
6161
github.com/spf13/pflag v1.0.5
6262
github.com/stretchr/testify v1.9.0
63-
github.com/vishvananda/netlink v1.3.1-0.20240905180732-b1ce50cfa9be
63+
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa
6464
github.com/vishvananda/netns v0.0.4
6565
go.etcd.io/etcd/api/v3 v3.5.16
6666
go.etcd.io/etcd/client/pkg/v3 v3.5.16

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG
462462
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
463463
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
464464
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
465-
github.com/vishvananda/netlink v1.3.1-0.20240905180732-b1ce50cfa9be h1:xdCMvyhnKzaepIUgVpUmTJo/+H1AQ7HuFYn1hv7/Neo=
466-
github.com/vishvananda/netlink v1.3.1-0.20240905180732-b1ce50cfa9be/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
465+
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa h1:iAhToRwOrdk+pKzclvLM7nKZhsg8f7dVrgkFccDUbUw=
466+
github.com/vishvananda/netlink v1.3.1-0.20250206174618-62fb240731fa/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
467467
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
468468
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
469469
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=

pkg/proxy/conntrack/cleanup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var protocolMap = map[v1.Protocol]uint8{
139139
// filterForNAT returns *conntrackFilter to delete the conntrack entries for connections
140140
// specified by the destination IP (original direction) and source IP (reply direction).
141141
func filterForNAT(origin, dest string, protocol v1.Protocol) *conntrackFilter {
142-
klog.V(4).InfoS("Adding conntrack filter for cleanup", "org-dst", origin, "reply-src", dest, "protocol", protocol)
142+
klog.V(6).InfoS("Adding conntrack filter for cleanup", "org-dst", origin, "reply-src", dest, "protocol", protocol)
143143
return &conntrackFilter{
144144
protocol: protocolMap[protocol],
145145
original: &connectionTuple{
@@ -154,7 +154,7 @@ func filterForNAT(origin, dest string, protocol v1.Protocol) *conntrackFilter {
154154
// filterForPortNAT returns *conntrackFilter to delete the conntrack entries for connections
155155
// specified by the destination Port (original direction) and source IP (reply direction).
156156
func filterForPortNAT(dest string, port int, protocol v1.Protocol) *conntrackFilter {
157-
klog.V(4).InfoS("Adding conntrack filter for cleanup", "org-port-dst", port, "reply-src", dest, "protocol", protocol)
157+
klog.V(6).InfoS("Adding conntrack filter for cleanup", "org-port-dst", port, "reply-src", dest, "protocol", protocol)
158158
return &conntrackFilter{
159159
protocol: protocolMap[protocol],
160160
original: &connectionTuple{

pkg/proxy/conntrack/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ func (f *conntrackFilter) MatchConntrackFlow(flow *netlink.ConntrackFlow) bool {
9696
}
9797

9898
// appending a new line to the flow makes klog print multiline log which is easier to debug and understand.
99-
klog.V(4).InfoS("Deleting conntrack entry", "flow", flow.String()+"\n")
99+
klog.V(5).InfoS("Deleting conntrack entry", "flow", flow.String()+"\n")
100100
return true
101101
}

vendor/github.com/vishvananda/netlink/addr_linux.go

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/vishvananda/netlink/bridge_linux.go

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/vishvananda/netlink/chain_linux.go

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/vishvananda/netlink/class_linux.go

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/vishvananda/netlink/conntrack_linux.go

Lines changed: 25 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)