Skip to content

Commit

Permalink
check payload of the NLMSG_DONE nlmsg
Browse files Browse the repository at this point in the history
check the payload of the NLMSG_DONE type netlink
message for possible error

Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
  • Loading branch information
Jianlin-lv committed Feb 7, 2020
1 parent 261f000 commit 723d1e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions nl/nl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 723d1e1

Please sign in to comment.