This commit is contained in:
JackDoan
2026-04-16 12:26:35 -05:00
parent b644131fd7
commit 2a0fd0be1d
2 changed files with 129 additions and 67 deletions

View File

@@ -485,15 +485,7 @@ 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 device
// Release the tun device (closing the tun also closes all readers)
return f.inside.Close()
}