of10: remove trailing NULs in OFPTableStats.name

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2013-08-26 15:34:38 +09:00 committed by FUJITA Tomonori
parent 24d91c929e
commit b972589906

View File

@ -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