diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-10 22:56:34 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-10 22:56:34 +0000 |
commit | ecaee47bf9e181c5418e316831bf47f3178cdf5c (patch) | |
tree | ff64760b576f2796e4b56b107332327588c25249 /pkg/tcpip/stack/nic.go | |
parent | d66bc3fa8d7717d0dffc1e857d3f2c0e30ad723c (diff) | |
parent | 53a95ad0dfe6123df5dd2bef5acfb81ebd796ff6 (diff) |
Merge release-20201130.0-80-g53a95ad0d (automated)
Diffstat (limited to 'pkg/tcpip/stack/nic.go')
-rw-r--r-- | pkg/tcpip/stack/nic.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go index 5887aa1ed..a6237dd5f 100644 --- a/pkg/tcpip/stack/nic.go +++ b/pkg/tcpip/stack/nic.go @@ -172,7 +172,7 @@ func (n *NIC) disable() { // // n MUST be locked. func (n *NIC) disableLocked() { - if !n.setEnabled(false) { + if !n.Enabled() { return } @@ -184,6 +184,10 @@ func (n *NIC) disableLocked() { for _, ep := range n.networkEndpoints { ep.Disable() } + + if !n.setEnabled(false) { + panic("should have only done work to disable the NIC if it was enabled") + } } // enable enables n. |