Skip to content

Commit 8e8c463

Browse files
committed
atmt: also use Session in IO supersockets
AI-Assisted: no
1 parent dcf69ed commit 8e8c463

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scapy/automaton.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ def recv(self, n=MTU, **kwargs): # type: ignore
681681
r = self.spb.recv(n)
682682
if self.proto is not None and r is not None:
683683
r = self.proto(r, **kwargs)
684+
if self.atmt.atmt_session is not None:
685+
# Apply session if provided
686+
r = self.atmt.atmt_session.process(r)
684687
return r
685688

686689
def close(self):
@@ -962,7 +965,8 @@ def parse_args(self, debug=0, store=0, session=None, **kargs):
962965
self.debug_level = debug
963966
if debug:
964967
conf.logLevel = logging.DEBUG
965-
self.atmt_session = session
968+
if session:
969+
self.atmt_session = session
966970
self.socket_kargs = kargs
967971
self.store_packets = store
968972

0 commit comments

Comments
 (0)