This patch adds the header_only parameter to nxm_entry's pack method. (The v2 patch didn't work correctly when asserts are enabled.)
Signed-off-by: Saul St. John <[email protected]> --- pox/openflow/nicira.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pox/openflow/nicira.py b/pox/openflow/nicira.py index 35499a3..f24bd52 100644 --- a/pox/openflow/nicira.py +++ b/pox/openflow/nicira.py @@ -507,7 +507,7 @@ class nx_reg_load (of.ofp_action_vendor_base): o = self.dst() o._force_mask = False - dst = o.pack(omittable=False)[:4] + dst = o.pack(omittable=False, header_only=True)[:4] p = struct.pack('!HH4sQ', self.subtype, ofs_nbits, dst, self.value) return p @@ -880,7 +880,7 @@ class nxm_entry (object): if self.is_reg != other.is_reg: return False return True - def pack (self, omittable = False): + def pack (self, omittable = False, header_only = False): h = self._nxm_type << 9 mask = self._mask @@ -904,6 +904,7 @@ class nxm_entry (object): r = struct.pack("!L", h) + if header_only: return r value = self._value assert value is not None assert len(value) == self._nxm_length, "value is wrong length" -- 1.7.10.4
