From e3a915af68a4bf39dc9b5ccc046bc4d491535b82 Mon Sep 17 00:00:00 2001
From: Phil <phil@secdev.org>
Date: Wed, 1 Aug 2007 18:52:34 +0200
Subject: [PATCH] Added keyboard interrupt handling to automaton loop

---
 scapy.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scapy.py b/scapy.py
index 2bd48f7b..6fd3762a 100755
--- a/scapy.py
+++ b/scapy.py
@@ -11519,7 +11519,9 @@ class Automaton:
             except ATMT.NewStateRequested,state_req:
                 self.debug(2, "switching from [%s] to [%s]" % (self.state.state,state_req.state))
                 self.state = state_req
-
+            except KeyboardInterrupt:
+                self.debug(1,"Interrupted by user")
+                break
 
     def my_send(self, pkt):
         self.send_sock.send(pkt)
-- 
GitLab