From 723d1e1493468ff8fd8029a6725184c78c4a8f6e Mon Sep 17 00:00:00 2001 From: Jianlin Lv Date: Thu, 6 Feb 2020 00:01:49 +0800 Subject: [PATCH] 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 --- nl/nl_linux.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nl/nl_linux.go b/nl/nl_linux.go index aaf56c67..25b4d01d 100644 --- a/nl/nl_linux.go +++ b/nl/nl_linux.go @@ -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 {