libcontainer: fix Boolmsg alignment
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
ec9bf50586
commit
ed58366cc8
|
@ -77,13 +77,13 @@ func (msg *Boolmsg) Serialize() []byte {
|
|||
native.PutUint16(buf[0:2], uint16(msg.Len()))
|
||||
native.PutUint16(buf[2:4], msg.Type)
|
||||
if msg.Value {
|
||||
buf[4] = 1
|
||||
native.PutUint32(buf[4:8], uint32(1))
|
||||
} else {
|
||||
buf[4] = 0
|
||||
native.PutUint32(buf[4:8], uint32(0))
|
||||
}
|
||||
return buf
|
||||
}
|
||||
|
||||
func (msg *Boolmsg) Len() int {
|
||||
return unix.NLA_HDRLEN + 1
|
||||
return unix.NLA_HDRLEN + 4 // alignment
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue