diff options
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index f5234c07..3feb09db 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -5106,19 +5106,18 @@ class OFPGroupMod(MsgBase): class OFPPortModPropEthernet(StringifyMixin): - _PACK_STR = '!HHI' # type, len, advertise - def __init__(self, type_=None, length=None, advertise=None): self.type = type_ self.advertise = advertise def serialize(self): # fixup - self.length = struct.calcsize(self._PACK_STR) + self.length = struct.calcsize( + ofproto.OFP_PORT_MOD_PROP_ETHERNET_PACK_STR) buf = bytearray() - msg_pack_into(self._PACK_STR, buf, 0, self.type, self.length, - self.advertise) + msg_pack_into(ofproto.OFP_PORT_MOD_PROP_ETHERNET_PACK_STR, + buf, 0, self.type, self.length, self.advertise) return buf |