summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomas Hozza <thozza@redhat.com>2013-03-13 17:14:12 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 22:23:15 +0400
commit77d6a5289343665a41f55c0ea46c169b3f551a24 (patch)
tree49c4c260c09235cb07fd558f62186fc93e163cca /tools
parent3334948428c6370d664099cdcdfd4b487191293d (diff)
downloadlinux-77d6a5289343665a41f55c0ea46c169b3f551a24.tar.xz
tools: hv: daemon should subscribe only to CN_KVP_IDX group
Previously HyperV daemon set sockaddr_nl.nl_groups to CN_KVP_IDX. Netlink documentation says: "nl_groups is a bit mask with every bit representing a netlink group number". Since CN_KVP_IDX value is "9" HyperV daemon was receiving Netlink messages also from group number "1" which is used by CGroup Rules Engine Daemon. This caused the daemon to segfault (at least on 2.6.32 kernel). HyperV daemon should set nl_groups to zero and specify multicast group CN_KVP_IDX only by using socket options. 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>
Diffstat (limited to 'tools')
-rw-r--r--tools/hv/hv_kvp_daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index c800ea4c8bf9..908a612ac992 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -1443,7 +1443,7 @@ int main(void)
addr.nl_family = AF_NETLINK;
addr.nl_pad = 0;
addr.nl_pid = 0;
- addr.nl_groups = CN_KVP_IDX;
+ addr.nl_groups = 0;
error = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
@@ -1452,7 +1452,7 @@ int main(void)
close(fd);
exit(EXIT_FAILURE);
}
- sock_opt = addr.nl_groups;
+ sock_opt = CN_KVP_IDX;
setsockopt(fd, 270, 1, &sock_opt, sizeof(sock_opt));
/*
* Register ourselves with the kernel.