I was getting an exception trying to write a pcap of some packets that had successfully been read from a pcap file and dug into the problem a bit. The problem appears to be that FloatField inherits the addfield method from BitField. This causes problems when the packet needs to be written out.
A good repeat-by for the problem is:
>>> from scapy import *
>>> VERSION
'1.2.0.2'
>>> pkt = NTP(delay=2.0, ref='None', precision=250L, dispersion=2.0, leap=3L, version=4L, mode=3L, stratum=0L, poll=4L, recv='None', id='0.0.0.0', sent='Mon, 19 May 2008 23:17:02 +0000', orig='None')
>>> str(pkt)
------------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wam/lib/python/scapy.py", line 5405, in __str__
return self.build()
File "/home/wam/lib/python/scapy.py", line 5449, in build
pkt = self.do_build()
File "/home/wam/lib/python/scapy.py", line 5436, in do_build
p = f.addfield(self, p, self.getfieldval(f.name))
File "/home/wam/lib/python/scapy.py", line 4271, in addfield
v |= val & ((1L<<self.size) - 1)
<type 'exceptions.TypeError'>: unsupported operand type(s) for &: 'float' and 'long'
The FloatField class has it's own getfield() method for pulling a apart 32 bit float on 16 bit boundaries from a standard BitField value. A similar routine probably needs to be written for addfield which is specific to FloatField. I'll try working up a fix for the problem, but it may take me time to come back up to speed on the internals of scapy.