Use OFP_PORT_MOD_PROP_ETHERNET_PACK_STR in
and remove _PACK_STR from OFPPortModPropEthernet.

Signed-off-by: Simon Horman <[email protected]>

---
v3
* First post
---
 ryu/ofproto/ofproto_v1_4_parser.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_4_parser.py 
b/ryu/ofproto/ofproto_v1_4_parser.py
index a53aa1b..39bc564 100644
--- a/ryu/ofproto/ofproto_v1_4_parser.py
+++ b/ryu/ofproto/ofproto_v1_4_parser.py
@@ -5070,19 +5070,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
 
 
-- 
1.8.5.2


------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to