Add Stack.ResetNetwork
This commit is contained in:
parent
79084fa798
commit
b59636919c
7 changed files with 64 additions and 5 deletions
|
|
@ -86,6 +86,15 @@ func (n *TCPNat) checkTimeout() {
|
|||
n.addrAccess.Unlock()
|
||||
}
|
||||
|
||||
func (n *TCPNat) Purge() {
|
||||
n.addrAccess.Lock()
|
||||
n.portAccess.Lock()
|
||||
clear(n.addrMap)
|
||||
clear(n.portMap)
|
||||
n.portAccess.Unlock()
|
||||
n.addrAccess.Unlock()
|
||||
}
|
||||
|
||||
func (n *TCPNat) LookupBack(port uint16) *TCPSession {
|
||||
n.portAccess.RLock()
|
||||
session := n.portMap[port]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue