MCPcopy
hub / github.com/cilium/cilium / RemoveAddress

Method RemoveAddress

pkg/mcastmanager/mcastmanager.go:64–82  ·  view source on GitHub ↗

RemoveAddress is called when an endpoint is removed

(ipv6 netip.Addr)

Source from the content-addressed store, hash-verified

62
63// RemoveAddress is called when an endpoint is removed
64func (mgr *MCastManager) RemoveAddress(ipv6 netip.Addr) {
65 if mgr.iface == "" || !ipv6.IsValid() {
66 return
67 }
68
69 key := multicast.Address(ipv6).Key()
70
71 mgr.mutex.Lock()
72 defer mgr.mutex.Unlock()
73
74 if m, ok := mgr.addresses[key]; ok {
75 delete(m, ipv6)
76 if len(m) == 0 {
77 // Last IP that has the solicited node maddr
78 mgr.leaveGroup(ipv6)
79 delete(mgr.addresses, key)
80 }
81 }
82}
83
84func (mgr *MCastManager) joinGroup(ipv6 netip.Addr) {
85 maddr := multicast.Address(ipv6).SolicitedNodeMaddr()

Callers 3

TestAddRemoveEndpointFunction · 0.80
TestAddRemoveNilFunction · 0.80
unexposeMethod · 0.80

Calls 6

leaveGroupMethod · 0.95
AddressTypeAlias · 0.92
KeyMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65
IsValidMethod · 0.45

Tested by 2

TestAddRemoveEndpointFunction · 0.64
TestAddRemoveNilFunction · 0.64