From 1174a1c72a4f35e5b32f0024cb1d61bc3ef34c83 Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 28 Jul 2008 16:13:00 +0200 Subject: [PATCH] Remove fields.py dependency on packet.py --- scapy/fields.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scapy/fields.py b/scapy/fields.py index cfd92fd66..339796ef7 100644 --- a/scapy/fields.py +++ b/scapy/fields.py @@ -472,8 +472,8 @@ class PacketField(StrField): def getfield(self, pkt, s): i = self.m2i(pkt, s) remain = "" - if i.haslayer(packet.Padding): - r = i.getlayer(packet.Padding) + if 'Padding' in i: + r = i['Padding'] del(r.underlayer.payload) remain = r.load return remain,i @@ -538,8 +538,8 @@ class PacketListField(PacketField): break c -= 1 p = self.m2i(pkt,remain) - if packet.Padding in p: - pad = p[packet.Padding] + if 'Padding' in p: + pad = p['Padding'] remain = pad.load del(pad.underlayer.payload) else: @@ -940,6 +940,3 @@ class FloatField(BitField): frac /= 65536.0 b = sec+frac return s,b - -# This import must come in last to avoid problems with cyclic dependencies -import packet