From 131e7245a8336541ee61047eac8ecb447129b963 Mon Sep 17 00:00:00 2001 From: Maxim Perevedentsev Date: Tue, 20 Oct 2015 18:44:19 +0300 Subject: [PATCH] netlink: add support for multi-part netlink messages. Such messages do not have NLMSG_ERROR or NLMSG_DONE type but they are valid responses. We test 'multi-partness' by looking for NLM_F_MULTI flag. --- src/util/virnetlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 0276522a2c..679b48e77b 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -394,7 +394,9 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen) break; default: - goto malformed_resp; + /* We allow multipart messages. */ + if (!(resp->nlmsg_flags & NLM_F_MULTI)) + goto malformed_resp; } return result;