mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Free multicastMemberships on UDP endpoint close
tcpip.Endpoint.Close is documented to free all resources associated with an endpoint so we don't need to create an empty map to clear the multicast memberships. PiperOrigin-RevId: 390609826
This commit is contained in:
committed by
gVisor bot
parent
ddcf884e9d
commit
eb0f24c6c4
@@ -266,7 +266,7 @@ func (e *endpoint) Close() {
|
||||
for mem := range e.multicastMemberships {
|
||||
e.stack.LeaveGroup(e.NetProto, mem.nicID, mem.multicastAddr)
|
||||
}
|
||||
e.multicastMemberships = make(map[multicastMembership]struct{})
|
||||
e.multicastMemberships = nil
|
||||
|
||||
// Close the receive list and drain it.
|
||||
e.rcvMu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user