check payload of the NLMSG_DONE nlmsg

check the payload of the NLMSG_DONE type netlink
message for possible error

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
This commit is contained in:
Jianlin Lv 2020-02-06 00:01:49 +08:00 committed by Alessandro Boch
parent 7ed9c95980
commit 5e92c072cd
1 changed files with 1 additions and 4 deletions

View File

@ -439,10 +439,7 @@ done:
if m.Header.Pid != pid {
continue
}
if m.Header.Type == unix.NLMSG_DONE {
break done
}
if m.Header.Type == unix.NLMSG_ERROR {
if m.Header.Type == unix.NLMSG_DONE || m.Header.Type == unix.NLMSG_ERROR {
native := NativeEndian()
error := int32(native.Uint32(m.Data[0:4]))
if error == 0 {