Improve network reset

This commit is contained in:
世界
2026-08-30 17:41:43 +08:00
parent 3afd290278
commit e4c8b49eaf
26 changed files with 250 additions and 62 deletions
+11
View File
@@ -26,6 +26,7 @@ import (
var (
_ adapter.OutboundWithPreferredRoutes = (*Endpoint)(nil)
_ adapter.InterfaceUpdateListener = (*Endpoint)(nil)
_ dialer.PacketDialerWithDestination = (*Endpoint)(nil)
)
@@ -159,6 +160,16 @@ func (w *Endpoint) Close() error {
return w.endpoint.Close()
}
func (w *Endpoint) InterfaceUpdated() {
if !w.started.Load() {
return
}
err := w.endpoint.BindUpdate()
if err != nil {
w.logger.Error(E.Cause(err, "update bind"))
}
}
func (w *Endpoint) PreMatchFlow(network string, destination netip.Addr) adapter.PreMatchAction {
return adapter.PreMatchFlow
}