Fix dhcp reset

This commit is contained in:
世界 2023-11-26 22:07:23 +08:00
parent a7b37c5953
commit 40a0b69918
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -87,9 +87,15 @@ func (t *Transport) Start() error {
}
func (t *Transport) Reset() {
for _, transport := range t.transports {
transport.Reset()
}
}
func (t *Transport) Close() error {
for _, transport := range t.transports {
transport.Close()
}
if t.interfaceCallback != nil {
t.router.InterfaceMonitor().UnregisterCallback(t.interfaceCallback)
}
@ -266,6 +272,9 @@ func (t *Transport) recreateServers(iface *net.Interface, serverAddrs []netip.Ad
}
transports = append(transports, serverTransport)
}
for _, transport := range t.transports {
transport.Close()
}
t.transports = transports
return nil
}