diff options
author | Tomas Hozza <thozza@redhat.com> | 2013-03-13 09:14:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-15 14:23:16 -0400 |
commit | f4685fa6d0427c3948a5120a9658fad7ae81facd (patch) | |
tree | 2b672c9a5f4fe3e64b60906ee0c3e4edcb116c15 /tools/hv/hv_kvp_daemon.c | |
parent | 77d6a5289343665a41f55c0ea46c169b3f551a24 (diff) |
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/hv_kvp_daemon.c')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 908a612ac992..704a0f9a063d 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
@@ -102,6 +102,10 @@ static struct utsname uts_buf; | |||
102 | #define MAX_FILE_NAME 100 | 102 | #define MAX_FILE_NAME 100 |
103 | #define ENTRIES_PER_BLOCK 50 | 103 | #define ENTRIES_PER_BLOCK 50 |
104 | 104 | ||
105 | #ifndef SOL_NETLINK | ||
106 | #define SOL_NETLINK 270 | ||
107 | #endif | ||
108 | |||
105 | struct kvp_record { | 109 | struct kvp_record { |
106 | char key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; | 110 | char key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; |
107 | char value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; | 111 | char value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; |
@@ -1407,7 +1411,7 @@ netlink_send(int fd, struct cn_msg *msg) | |||
1407 | 1411 | ||
1408 | int main(void) | 1412 | int main(void) |
1409 | { | 1413 | { |
1410 | int fd, len, sock_opt; | 1414 | int fd, len, nl_group; |
1411 | int error; | 1415 | int error; |
1412 | struct cn_msg *message; | 1416 | struct cn_msg *message; |
1413 | struct pollfd pfd; | 1417 | struct pollfd pfd; |
@@ -1452,8 +1456,8 @@ int main(void) | |||
1452 | close(fd); | 1456 | close(fd); |
1453 | exit(EXIT_FAILURE); | 1457 | exit(EXIT_FAILURE); |
1454 | } | 1458 | } |
1455 | sock_opt = CN_KVP_IDX; | 1459 | nl_group = CN_KVP_IDX; |
1456 | setsockopt(fd, 270, 1, &sock_opt, sizeof(sock_opt)); | 1460 | setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &nl_group, sizeof(nl_group)); |
1457 | /* | 1461 | /* |
1458 | * Register ourselves with the kernel. | 1462 | * Register ourselves with the kernel. |
1459 | */ | 1463 | */ |