]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
tools: hv: daemon should check type of received Netlink msg
authorTomas Hozza <thozza@redhat.com>
Wed, 13 Mar 2013 13:14:14 +0000 (14:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 18:23:16 +0000 (11:23 -0700)
HyperV KVP daemon should check nlmsg_type in received netlink message
header. If message type is NLMSG_DONE daemon can proceed with processing
otherwise it should wait for next message.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/hv/hv_kvp_daemon.c

index 704a0f9a063db8531cb3d1f30708447b4d1b6d8f..5a1f6489d185a10f20616de81c6d145f3ff01b86 100644 (file)
@@ -1503,6 +1503,10 @@ int main(void)
                }
 
                incoming_msg = (struct nlmsghdr *)kvp_recv_buffer;
+
+               if (incoming_msg->nlmsg_type != NLMSG_DONE)
+                       continue;
+
                incoming_cn_msg = (struct cn_msg *)NLMSG_DATA(incoming_msg);
                hv_msg = (struct hv_kvp_msg *)incoming_cn_msg->data;