From d5be199501fdd0e3d1ee9811f38bc2bc59718594 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Fri, 24 Mar 2017 16:40:04 +0900 Subject: zebra/zapi: Fix offset calculation in IPRouteBody Signed-off-by: IWASE Yusuke --- zebra/zapi.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'zebra/zapi.go') diff --git a/zebra/zapi.go b/zebra/zapi.go index f4b8615e..0c131f7f 100644 --- a/zebra/zapi.go +++ b/zebra/zapi.go @@ -850,14 +850,15 @@ func (b *IPRouteBody) DecodeFromBytes(data []byte, version uint8) error { if b.Message&MESSAGE_DISTANCE > 0 { b.Distance = data[pos] + pos += 1 } if b.Message&MESSAGE_METRIC > 0 { - pos += 1 b.Metric = binary.BigEndian.Uint32(data[pos : pos+4]) + pos += 4 } if b.Message&MESSAGE_MTU > 0 { - pos += 4 b.Mtu = binary.BigEndian.Uint32(data[pos : pos+4]) + pos += 4 } return nil -- cgit v1.2.3