diff options
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rwxr-xr-x | pkg/tcpip/transport/tcp/tcp_endpoint_list.go | 8 | ||||
-rwxr-xr-x | pkg/tcpip/transport/tcp/tcp_segment_list.go | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go index 32ac43dca..62c042aff 100755 --- a/pkg/tcpip/transport/tcp/tcp_endpoint_list.go +++ b/pkg/tcpip/transport/tcp/tcp_endpoint_list.go @@ -135,8 +135,9 @@ func (l *endpointList) InsertBefore(a, e *endpoint) { // Remove removes e from l. func (l *endpointList) Remove(e *endpoint) { - prev := endpointElementMapper{}.linkerFor(e).Prev() - next := endpointElementMapper{}.linkerFor(e).Next() + linker := endpointElementMapper{}.linkerFor(e) + prev := linker.Prev() + next := linker.Next() if prev != nil { endpointElementMapper{}.linkerFor(prev).SetNext(next) @@ -149,6 +150,9 @@ func (l *endpointList) Remove(e *endpoint) { } else { l.tail = prev } + + linker.SetNext(nil) + linker.SetPrev(nil) } // Entry is a default implementation of Linker. Users can add anonymous fields diff --git a/pkg/tcpip/transport/tcp/tcp_segment_list.go b/pkg/tcpip/transport/tcp/tcp_segment_list.go index 9b21b87ad..27f17f037 100755 --- a/pkg/tcpip/transport/tcp/tcp_segment_list.go +++ b/pkg/tcpip/transport/tcp/tcp_segment_list.go @@ -135,8 +135,9 @@ func (l *segmentList) InsertBefore(a, e *segment) { // Remove removes e from l. func (l *segmentList) Remove(e *segment) { - prev := segmentElementMapper{}.linkerFor(e).Prev() - next := segmentElementMapper{}.linkerFor(e).Next() + linker := segmentElementMapper{}.linkerFor(e) + prev := linker.Prev() + next := linker.Next() if prev != nil { segmentElementMapper{}.linkerFor(prev).SetNext(next) @@ -149,6 +150,9 @@ func (l *segmentList) Remove(e *segment) { } else { l.tail = prev } + + linker.SetNext(nil) + linker.SetPrev(nil) } // Entry is a default implementation of Linker. Users can add anonymous fields |