mirror of
https://github.com/bettercap/bettercap
synced 2025-07-10 23:33:28 -07:00
fix: deleting firewall port redirection when tcp.proxy is stopped
This commit is contained in:
parent
b7a9712e52
commit
b361856c0b
1 changed files with 9 additions and 0 deletions
|
@ -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()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue