diff options
-rw-r--r-- | ryu/ofproto/oxm_fields.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py index 1f83a70e..e89d1ebc 100644 --- a/ryu/ofproto/oxm_fields.py +++ b/ryu/ofproto/oxm_fields.py @@ -188,6 +188,10 @@ def to_user(num_to_field, n, v, m): t = UnknownType name = 'field_%d' % n if not v is None: + if hasattr(t, 'size') and t.size != len(v): + raise Exception( + 'Unexpected OXM payload length %d for %s (expected %d)' + % (len(v), name, t.size)) value = t.to_user(v) else: value = None |