mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 07:12:22 +08:00
Fix dhcp reset
This commit is contained in:
parent
a7b37c5953
commit
40a0b69918
|
@ -87,9 +87,15 @@ func (t *Transport) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Transport) Reset() {
|
func (t *Transport) Reset() {
|
||||||
|
for _, transport := range t.transports {
|
||||||
|
transport.Reset()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Transport) Close() error {
|
func (t *Transport) Close() error {
|
||||||
|
for _, transport := range t.transports {
|
||||||
|
transport.Close()
|
||||||
|
}
|
||||||
if t.interfaceCallback != nil {
|
if t.interfaceCallback != nil {
|
||||||
t.router.InterfaceMonitor().UnregisterCallback(t.interfaceCallback)
|
t.router.InterfaceMonitor().UnregisterCallback(t.interfaceCallback)
|
||||||
}
|
}
|
||||||
|
@ -266,6 +272,9 @@ func (t *Transport) recreateServers(iface *net.Interface, serverAddrs []netip.Ad
|
||||||
}
|
}
|
||||||
transports = append(transports, serverTransport)
|
transports = append(transports, serverTransport)
|
||||||
}
|
}
|
||||||
|
for _, transport := range t.transports {
|
||||||
|
transport.Close()
|
||||||
|
}
|
||||||
t.transports = transports
|
t.transports = transports
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user