Remove NICs on stack shutdown to ensure qdisc cleanup.

PiperOrigin-RevId: 424149803
This commit is contained in:
Bhasker Hariharan
2022-01-25 12:28:57 -08:00
committed by gVisor bot
parent f3ff82093e
commit 434e58d261
+7 -3
View File
@@ -1530,9 +1530,13 @@ func (s *Stack) Wait() {
p.Wait()
}
s.mu.RLock()
defer s.mu.RUnlock()
for _, n := range s.nics {
s.mu.Lock()
defer s.mu.Unlock()
for id, n := range s.nics {
// Remove NIC to ensure that qDisc goroutines are correctly
// terminated on stack teardown.
s.removeNICLocked(id)
n.NetworkLinkEndpoint.Wait()
}
}