mirror of
https://github.com/slackhq/nebula.git
synced 2026-02-15 09:14:23 +01:00
use shutdown
This commit is contained in:
12
interface.go
12
interface.go
@@ -505,20 +505,12 @@ func (f *Interface) Close() error {
|
||||
f.l.WithError(err).Error("Error while closing udp socket")
|
||||
}
|
||||
}
|
||||
for i, r := range f.readers {
|
||||
if i == 0 {
|
||||
continue // f.readers[0] is f.inside, which we want to save for last
|
||||
}
|
||||
if err := r.Close(); err != nil {
|
||||
f.l.WithError(err).Error("Error while closing tun reader")
|
||||
}
|
||||
}
|
||||
|
||||
// Release the tun readers
|
||||
for _, u := range f.readers {
|
||||
for i, u := range f.readers {
|
||||
err := u.Close()
|
||||
if err != nil {
|
||||
f.l.WithError(err).Error("Error while closing tun device")
|
||||
f.l.WithError(err).WithField("i", i).Error("Error while closing tun device")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user