diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-06-09 18:35:56 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-09 18:35:56 +0000 |
commit | 1095c4a7490d815b33c6004c1247d0adce0f08e0 (patch) | |
tree | e58faf6474a3edd3ddd8ee23e266f33d2aee9bc6 /pkg/tcpip/stack/stack.go | |
parent | 9d4fc7c8805367764e015f18fb9b306fa870a95a (diff) | |
parent | 2d3b9d18e79c93dc3186b60de06ec587852c980f (diff) |
Merge release-20200522.0-102-g2d3b9d18e (automated)
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 294ce8775..648791302 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -1017,6 +1017,13 @@ func (s *Stack) RemoveNIC(id tcpip.NICID) *tcpip.Error { s.mu.Lock() defer s.mu.Unlock() + return s.removeNICLocked(id) +} + +// removeNICLocked removes NIC and all related routes from the network stack. +// +// s.mu must be locked. +func (s *Stack) removeNICLocked(id tcpip.NICID) *tcpip.Error { nic, ok := s.nics[id] if !ok { return tcpip.ErrUnknownNICID |