packet lib: sctp: correct len(sctp)

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yuichi Ito 2013-11-01 14:15:35 +09:00 committed by FUJITA Tomonori
parent 203e3a575e
commit e6a4f5897f

View File

@ -139,6 +139,13 @@ class sctp(packet_base.PacketBase):
struct.pack_into('!I', buf, 8, self.csum)
return str(buf)
def __len__(self):
length = self._MIN_LEN
if self.chunks is not None:
for one in self.chunks:
length += len(one)
return length
def _checksum(self, data):
# from RFC 3309
crc_c = [