Skip to content

Commit ee15257

Browse files
author
pbi
committed
- fixed ScapyFreqFilter (ticket #19)
1 parent 0e8bfcb commit ee15257

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scapy.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
#
2323
# $Log: scapy.py,v $
24+
# Revision 1.0.4.106 2006/10/17 16:50:19 pbi
25+
# - fixed ScapyFreqFilter (ticket #19)
26+
#
2427
# Revision 1.0.4.105 2006/10/17 16:12:03 pbi
2528
# - added 'count' parameter to send()/sendp() and __gen_send() to send the same set of
2629
# packets a given number of times
@@ -1724,7 +1727,7 @@
17241727

17251728
from __future__ import generators
17261729

1727-
RCSID="$Id: scapy.py,v 1.0.4.105 2006/10/17 16:12:03 pbi Exp $"
1730+
RCSID="$Id: scapy.py,v 1.0.4.106 2006/10/17 16:50:19 pbi Exp $"
17281731

17291732
VERSION = RCSID.split()[2]+"beta"
17301733

@@ -1759,8 +1762,12 @@ def __init__(self):
17591762
def filter(self, record):
17601763
wt = conf.warning_threshold
17611764
if wt > 0:
1762-
stk = traceback.extract_stack(limit=1)
1763-
caller = stk[0][1]
1765+
stk = traceback.extract_stack()
1766+
caller=None
1767+
for f,l,n,c in stk:
1768+
if n == 'warning':
1769+
break
1770+
caller = l
17641771
tm,nb = self.warning_table.get(caller, (0,0))
17651772
ltm = time.time()
17661773
if ltm-tm > wt:

0 commit comments

Comments
 (0)