Skip to content

Commit

Permalink
fix dhcp 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 26, 2023
1 parent 0f643bf commit 1c1eb01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions transport/dhcp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 1c1eb01

Please sign in to comment.