summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/ofproto/ofproto_v1_3_parser.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py
index 3542b5d0..f59c65d6 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -400,7 +400,18 @@ class OFPMatch(StringifyMixin):
stringify_attrs = iteritems
def to_jsondict(self):
- return super(OFPMatch, self).to_jsondict(lambda x: x)
+ # XXX old api compat
+ if self._composed_with_old_api():
+ # copy object first because serialize_old is destructive
+ o2 = OFPMatch()
+ o2.fields = self.fields[:]
+ # serialize and parse to fill OFPMatch._fields2
+ buf = bytearray()
+ o2.serialize(buf, 0)
+ o = OFPMatch.parser(str(buf), 0)
+ else:
+ o = self
+ return super(OFPMatch, o).to_jsondict(lambda x: x)
@classmethod
def from_jsondict(cls, dict_):