From ed58366cc8325b860216462072511ae9ab14a76a Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Mon, 15 Jan 2018 18:09:08 +0900 Subject: [PATCH] libcontainer: fix Boolmsg alignment Signed-off-by: Akihiro Suda --- libcontainer/message_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcontainer/message_linux.go b/libcontainer/message_linux.go index ab453cde..ed7f986d 100644 --- a/libcontainer/message_linux.go +++ b/libcontainer/message_linux.go @@ -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 }