Skip to content
Snippets Groups Projects
Commit e211d70e authored by Pierre LALET's avatar Pierre LALET
Browse files

Tiny code cleanup

parent c2ff2ce9
No related branches found
No related tags found
No related merge requests found
...@@ -395,12 +395,11 @@ class L3PacketSocket(SuperSocket): ...@@ -395,12 +395,11 @@ class L3PacketSocket(SuperSocket):
sdto = (iff, conf.l3types[type(x)]) sdto = (iff, conf.l3types[type(x)])
if sn[3] in conf.l2types: if sn[3] in conf.l2types:
ll = lambda x:conf.l2types[sn[3]]()/x ll = lambda x:conf.l2types[sn[3]]()/x
sx = str(ll(x))
x.sent_time = time.time()
try: try:
sx = str(ll(x))
x.sent_time = time.time()
self.outs.sendto(sx, sdto) self.outs.sendto(sx, sdto)
except socket.error, msg: except socket.error, msg:
x.sent_time = time.time() # bad approximation
if msg[0] == 22 and len(sx) < conf.min_pkt_size: if msg[0] == 22 and len(sx) < conf.min_pkt_size:
self.outs.send(sx + "\x00" * (conf.min_pkt_size - len(sx))) self.outs.send(sx + "\x00" * (conf.min_pkt_size - len(sx)))
elif conf.auto_fragment and msg[0] == 90: elif conf.auto_fragment and msg[0] == 90:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment