From b9725899065d14fd4e1fd27fc6d4ec56ff6e47c1 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 26 Aug 2013 15:34:38 +0900 Subject: [PATCH] of10: remove trailing NULs in OFPTableStats.name Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_0_parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py index be031894..7ed33c1f 100644 --- a/ryu/ofproto/ofproto_v1_0_parser.py +++ b/ryu/ofproto/ofproto_v1_0_parser.py @@ -1079,6 +1079,9 @@ class OFPTableStats(ofproto_parser.namedtuple('OFPTableStats', ( def parser(cls, buf, offset): tbl = struct.unpack_from(ofproto_v1_0.OFP_TABLE_STATS_PACK_STR, buf, offset) + tbl = list(tbl) + i = cls._fields.index('name') + tbl[i] = tbl[i].rstrip('\0') stats = cls(*tbl) stats.length = ofproto_v1_0.OFP_TABLE_STATS_SIZE return stats