From: Maxim Perevedentsev Date: Tue, 20 Oct 2015 15:44:19 +0000 (+0300) Subject: netlink: add support for multi-part netlink messages. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=131e7245a8336541ee61047eac8ecb447129b963;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git 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. --- diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 0276522a2..679b48e77 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;