diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2017-03-24 16:40:04 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-04-01 16:10:30 +0900 |
commit | d5be199501fdd0e3d1ee9811f38bc2bc59718594 (patch) | |
tree | 231dafb701381d0a27f98c066b5a46e1f337260a | |
parent | 1d3225bd297d9522eb42cf2fae63f332ee8e00a2 (diff) |
zebra/zapi: Fix offset calculation in IPRouteBody
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
-rw-r--r-- | zebra/zapi.go | 5 |
1 files changed, 3 insertions, 2 deletions
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 |