Fix a panic in parseTbfData.

Include all 8 bytes when generating the native Uint64 otherwise this
code may encounter an index out of range panic.
This commit is contained in:
Vishvananda Ishaya Abrams
2017-01-05 15:59:13 -08:00
parent ade05d5c8f
commit 1890b34fa3

View File

@@ -423,7 +423,7 @@ func parseTbfData(qdisc Qdisc, data []syscall.NetlinkRouteAttr) error {
tbf.Limit = opt.Limit
tbf.Buffer = opt.Buffer
case nl.TCA_TBF_RATE64:
tbf.Rate = native.Uint64(datum.Value[0:4])
tbf.Rate = native.Uint64(datum.Value[0:8])
}
}
return nil