Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Commit

Permalink
Fix: Resetting packet forwarding only AFTER restore packets are sent.
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Feb 26, 2016
1 parent 18b12de commit e6deb54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bettercap/network/packet_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def wait_empty( timeout )

# Notify the queue to stop and wait for every worker to finish.
def stop
wait_empty( 60 )
wait_empty( 6000 )
@running = false
@nworkers.times { push(nil) }
@workers.map(&:join)
Expand Down
6 changes: 4 additions & 2 deletions lib/bettercap/spoofers/arp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def stop
raise 'ARP spoofer is not running' unless @running

Logger.debug 'Stopping ARP spoofer ...'
Logger.debug "Resetting packet forwarding to #{@forwarding} ..."
@ctx.firewall.enable_forwarding( @forwarding )

@running = false
begin
Expand All @@ -86,6 +84,10 @@ def stop
end
end
end

Logger.debug "Resetting packet forwarding to #{@forwarding} ..."

@ctx.firewall.enable_forwarding( @forwarding )
end

private
Expand Down

0 comments on commit e6deb54

Please sign in to comment.