MCPcopy
hub / github.com/cilium/cilium / AddAddress

Method AddAddress

pkg/mcastmanager/mcastmanager.go:44–61  ·  view source on GitHub ↗

AddAddress is called when a new endpoint is added

(ipv6 netip.Addr)

Source from the content-addressed store, hash-verified

42
43// AddAddress is called when a new endpoint is added
44func (mgr *MCastManager) AddAddress(ipv6 netip.Addr) {
45 if mgr.iface == "" || !ipv6.IsValid() {
46 return
47 }
48
49 key := multicast.Address(ipv6).Key()
50
51 mgr.mutex.Lock()
52 defer mgr.mutex.Unlock()
53
54 if _, ok := mgr.addresses[key]; !ok {
55 // First IP that has the solicited node maddr
56 mgr.joinGroup(ipv6)
57 mgr.addresses[key] = map[netip.Addr]struct{}{}
58 }
59
60 mgr.addresses[key][ipv6] = struct{}{}
61}
62
63// RemoveAddress is called when an endpoint is removed
64func (mgr *MCastManager) RemoveAddress(ipv6 netip.Addr) {

Callers 3

TestAddRemoveEndpointFunction · 0.80
TestAddRemoveNilFunction · 0.80
exposeMethod · 0.80

Calls 6

joinGroupMethod · 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