]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
netlink: add support for multi-part netlink messages.
authorMaxim Perevedentsev <mperevedentsev@virtuozzo.com>
Tue, 20 Oct 2015 15:44:19 +0000 (18:44 +0300)
committerLaine Stump <laine@laine.org>
Thu, 29 Oct 2015 01:47:58 +0000 (21:47 -0400)
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

index 0276522a2cafa3245bc066802cca01bd7ed2c3fe..679b48e77b7b892c92003065f210a111a45b6401 100644 (file)
@@ -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;