ospf: fix serialize() to work with packet.Packet()

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
ISHIDA Wataru 2015-07-30 22:12:02 +09:00 committed by FUJITA Tomonori
parent 65205dcdb0
commit 27b7a524d4

View File

@ -688,7 +688,7 @@ class OSPFMessage(packet_base.PacketBase, _TypeDisp):
except: except:
return None, None, buf return None, None, buf
def serialize(self): def serialize(self, payload=None, prev=None):
tail = self.serialize_tail() tail = self.serialize_tail()
self.length = self._HDR_LEN + len(tail) self.length = self._HDR_LEN + len(tail)
head = bytearray(struct.pack(self._HDR_PACK_STR, self.version, head = bytearray(struct.pack(self._HDR_PACK_STR, self.version,