Skip to content

Commit

Permalink
Fixed small bug in tcptrace.
Browse files Browse the repository at this point in the history
darcs-hash:20090501063748-f1522-a16c660ccc8b80f2ac3b43ea2501458a81d87262.gz
  • Loading branch information
scudette committed May 1, 2009
1 parent ce3c6c3 commit 4274c62
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions utilities/tcptrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,23 @@ def Callback(mode, packet, connection, options = None):
connection['l'] = 0
connection['packets'] = []

tcp = packet.find_type("TCP")
try:
tcp = packet.find_type("TCP")
except AttributeError:
tcp = packet.find_type("UDP")

connection['src_port'] = tcp.source
connection['dest_port'] = tcp.dest

if tcp.data_len > 0:
Callback('data', packet, connection)

if mode=='data':
tcp = packet.find_type("TCP")
try:
tcp = packet.find_type("TCP")
except AttributeError:
tcp = packet.find_type("UDP")

data = tcp.data
fd = connection['data']
connection['packets'].append(dict(offset = packet.offset,
Expand Down

0 comments on commit 4274c62

Please sign in to comment.