summaryrefslogtreecommitdiffhomepage
path: root/zebra/zapi.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-03-24 16:40:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-04-01 16:10:30 +0900
commitd5be199501fdd0e3d1ee9811f38bc2bc59718594 (patch)
tree231dafb701381d0a27f98c066b5a46e1f337260a /zebra/zapi.go
parent1d3225bd297d9522eb42cf2fae63f332ee8e00a2 (diff)
zebra/zapi: Fix offset calculation in IPRouteBody
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'zebra/zapi.go')
-rw-r--r--zebra/zapi.go5
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