mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-19 07:44:24 +00:00
Improve network reset
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user