fix: deleting firewall port redirection when tcp.proxy is stopped

This commit is contained in:
evilsocket 2018-08-14 14:03:11 +02:00
parent b7a9712e52
commit b361856c0b
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -236,6 +236,15 @@ func (p *TcpProxy) Start() error {
} }
func (p *TcpProxy) Stop() error { func (p *TcpProxy) Stop() error {
if p.Redirection != nil {
log.Debug("Disabling redirection %s", p.Redirection.String())
if err := p.Session.Firewall.EnableRedirection(p.Redirection, false); err != nil {
return err
}
p.Redirection = nil
}
return p.SetRunning(false, func() { return p.SetRunning(false, func() {
p.listener.Close() p.listener.Close()
}) })