diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-09 21:20:14 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-09 21:20:14 +0000 |
commit | 516bba9edc31647cbbe4cb238ff9390d3eaf5c46 (patch) | |
tree | b8a64ab3d2c4c3ad1ede8a0181a8613213ff5347 /pkg/tcpip/stack | |
parent | b8b4b5363d756082c4135d9de9392b49e1c12531 (diff) | |
parent | 8643933d6e58492cbe9d5c78124873ab40f65feb (diff) |
Merge release-20191213.0-86-g8643933 (automated)
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index e2a2edb2c..41bf9fd9b 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -901,6 +901,14 @@ type NICInfo struct { Context NICContext } +// HasNIC returns true if the NICID is defined in the stack. +func (s *Stack) HasNIC(id tcpip.NICID) bool { + s.mu.RLock() + _, ok := s.nics[id] + s.mu.RUnlock() + return ok +} + // NICInfo returns a map of NICIDs to their associated information. func (s *Stack) NICInfo() map[tcpip.NICID]NICInfo { s.mu.RLock() |