Add Stack.ResetNetwork

This commit is contained in:
世界 2026-07-19 17:41:50 +08:00
parent 79084fa798
commit b59636919c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 64 additions and 5 deletions

View file

@ -134,6 +134,16 @@ func (t *GVisor) Start() error {
return nil
}
func (t *GVisor) ResetNetwork() {
if t.udpForwarder != nil {
t.udpForwarder.udpNat.Purge()
}
if t.icmpForwarder != nil {
t.icmpForwarder.Purge()
}
t.dispatcher.ResetNetwork()
}
func (t *GVisor) Close() error {
t.dispatcher.Close()
if t.icmpForwarder != nil {