summaryrefslogtreecommitdiffstats
path: root/tools/hv
diff options
context:
space:
mode:
authorTomas Hozza <thozza@redhat.com>2013-03-13 14:14:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 11:23:16 -0700
commitf4685fa6d0427c3948a5120a9658fad7ae81facd (patch)
tree2b672c9a5f4fe3e64b60906ee0c3e4edcb116c15 /tools/hv
parent77d6a5289343665a41f55c0ea46c169b3f551a24 (diff)
downloadop-kernel-dev-f4685fa6d0427c3948a5120a9658fad7ae81facd.zip
op-kernel-dev-f4685fa6d0427c3948a5120a9658fad7ae81facd.tar.gz
tools: hv: daemon setsockopt should use options macros
HyperV daemon should use macros for option values when calling setsockopt. Using specific numeric values instead of macros is confusing. 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/hv')
-rw-r--r--tools/hv/hv_kvp_daemon.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 908a612..704a0f9 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -102,6 +102,10 @@ static struct utsname uts_buf;
#define MAX_FILE_NAME 100
#define ENTRIES_PER_BLOCK 50
+#ifndef SOL_NETLINK
+#define SOL_NETLINK 270
+#endif
+
struct kvp_record {
char key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
char value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
@@ -1407,7 +1411,7 @@ netlink_send(int fd, struct cn_msg *msg)
int main(void)
{
- int fd, len, sock_opt;
+ int fd, len, nl_group;
int error;
struct cn_msg *message;
struct pollfd pfd;
@@ -1452,8 +1456,8 @@ int main(void)
close(fd);
exit(EXIT_FAILURE);
}
- sock_opt = CN_KVP_IDX;
- setsockopt(fd, 270, 1, &sock_opt, sizeof(sock_opt));
+ nl_group = CN_KVP_IDX;
+ setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group));
/*
* Register ourselves with the kernel.
*/
OpenPOWER on IntegriCloud