summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/transport/udp')
-rwxr-xr-xpkg/tcpip/transport/udp/udp_packet_list.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/tcpip/transport/udp/udp_packet_list.go b/pkg/tcpip/transport/udp/udp_packet_list.go
index 00535d242..2ae846eaa 100755
--- a/pkg/tcpip/transport/udp/udp_packet_list.go
+++ b/pkg/tcpip/transport/udp/udp_packet_list.go
@@ -135,8 +135,9 @@ func (l *udpPacketList) InsertBefore(a, e *udpPacket) {
// Remove removes e from l.
func (l *udpPacketList) Remove(e *udpPacket) {
- prev := udpPacketElementMapper{}.linkerFor(e).Prev()
- next := udpPacketElementMapper{}.linkerFor(e).Next()
+ linker := udpPacketElementMapper{}.linkerFor(e)
+ prev := linker.Prev()
+ next := linker.Next()
if prev != nil {
udpPacketElementMapper{}.linkerFor(prev).SetNext(next)
@@ -149,6 +150,9 @@ func (l *udpPacketList) Remove(e *udpPacket) {
} else {
l.tail = prev
}
+
+ linker.SetNext(nil)
+ linker.SetPrev(nil)
}
// Entry is a default implementation of Linker. Users can add anonymous fields