diff --git a/box.go b/box.go index dbba6389..8132e462 100644 --- a/box.go +++ b/box.go @@ -277,7 +277,7 @@ func (s *Box) Close() error { } for i, out := range s.outbounds { errors = E.Append(errors, common.Close(out), func(err error) error { - return E.Cause(err, "close inbound/", out.Type(), "[", i, "]") + return E.Cause(err, "close outbound/", out.Type(), "[", i, "]") }) } if err := common.Close(s.router); err != nil { diff --git a/outbound/wireguard.go b/outbound/wireguard.go index dd194729..cdba9812 100644 --- a/outbound/wireguard.go +++ b/outbound/wireguard.go @@ -179,5 +179,6 @@ func (w *WireGuard) Close() error { if w.device != nil { w.device.Close() } - return common.Close(w.tunDevice) + w.tunDevice.Close() + return nil }