From: Tomas Hozza Date: Wed, 13 Mar 2013 13:14:14 +0000 (+0100) Subject: tools: hv: daemon should check type of received Netlink msg X-Git-Tag: firefly_0821_release~3680^2~676^2~116 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75db601496e97ffa2476dcd00053c0ca95e977a5;p=firefly-linux-kernel-4.4.55.git tools: hv: daemon should check type of received Netlink msg 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 Acked-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman --- diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 704a0f9a063d..5a1f6489d185 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c @@ -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;