diff options
Diffstat (limited to 'pkg/tcpip/transport/packet')
-rwxr-xr-x | pkg/tcpip/transport/packet/packet_list.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/packet/packet_list.go b/pkg/tcpip/transport/packet/packet_list.go index e8c4cba0d..ad27c7c06 100755 --- a/pkg/tcpip/transport/packet/packet_list.go +++ b/pkg/tcpip/transport/packet/packet_list.go @@ -135,8 +135,9 @@ func (l *packetList) InsertBefore(a, e *packet) { // Remove removes e from l. func (l *packetList) Remove(e *packet) { - prev := packetElementMapper{}.linkerFor(e).Prev() - next := packetElementMapper{}.linkerFor(e).Next() + linker := packetElementMapper{}.linkerFor(e) + prev := linker.Prev() + next := linker.Next() if prev != nil { packetElementMapper{}.linkerFor(prev).SetNext(next) @@ -149,6 +150,9 @@ func (l *packetList) Remove(e *packet) { } else { l.tail = prev } + + linker.SetNext(nil) + linker.SetPrev(nil) } // Entry is a default implementation of Linker. Users can add anonymous fields |