summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-11-30 22:27:48 +0000
committergVisor bot <gvisor-bot@google.com>2020-11-30 22:27:48 +0000
commite236d392b180e164b6631d18d64ff2f69a374446 (patch)
tree6cbb7f1e4727d4d552034960cb267c1429263902 /pkg/tcpip/stack
parent5b624f21ee562ccc0b9fe64bb8a0243b0daffc40 (diff)
parente813008664ffb361211936dda8631754411cca4f (diff)
Merge release-20201117.0-78-ge81300866 (automated)
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r--pkg/tcpip/stack/addressable_endpoint_state.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/addressable_endpoint_state.go b/pkg/tcpip/stack/addressable_endpoint_state.go
index adeebfe37..6e855d815 100644
--- a/pkg/tcpip/stack/addressable_endpoint_state.go
+++ b/pkg/tcpip/stack/addressable_endpoint_state.go
@@ -625,6 +625,17 @@ func (a *AddressableEndpointState) IsInGroup(group tcpip.Address) bool {
return ok
}
+// JoinedGroups returns a list of groups the endpoint is a member of.
+func (a *AddressableEndpointState) JoinedGroups() []tcpip.Address {
+ a.mu.RLock()
+ defer a.mu.RUnlock()
+ groups := make([]tcpip.Address, 0, len(a.mu.groups))
+ for g := range a.mu.groups {
+ groups = append(groups, g)
+ }
+ return groups
+}
+
// Cleanup forcefully leaves all groups and removes all permanent addresses.
func (a *AddressableEndpointState) Cleanup() {
a.mu.Lock()