Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From 2686213259b15df9cf1d969c5a14d62f14cfbaae Mon Sep 17 00:00:00 2001 |
| 2 | From: Jianchuan Wang <jianchuan.wang@windriver.com> |
| 3 | Date: Thu, 8 Jan 2015 17:37:11 +0800 |
| 4 | Subject: [PATCH 2/2] Replace nl_handle to nl_sock. |
| 5 | |
| 6 | The nl_handle was replace with nl_sock in the libnl-3. |
| 7 | |
| 8 | Upstream-Status: Inappropriate [embedded specific] |
| 9 | |
| 10 | Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> |
| 11 | --- |
| 12 | libipvs/libipvs.c | 10 +++++----- |
| 13 | 1 file changed, 5 insertions(+), 5 deletions(-) |
| 14 | |
| 15 | diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c |
| 16 | index a157e18..21a9bfa 100644 |
| 17 | --- a/libipvs/libipvs.c |
| 18 | +++ b/libipvs/libipvs.c |
| 19 | @@ -32,7 +32,7 @@ static void* ipvs_func = NULL; |
| 20 | struct ip_vs_getinfo ipvs_info; |
| 21 | |
| 22 | #ifdef LIBIPVS_USE_NL |
| 23 | -static struct nl_handle *sock = NULL; |
| 24 | +static struct nl_sock *sock = NULL; |
| 25 | static int family, try_nl = 1; |
| 26 | #endif |
| 27 | |
| 28 | @@ -73,7 +73,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg |
| 29 | { |
| 30 | int err = EINVAL; |
| 31 | |
| 32 | - sock = nl_handle_alloc(); |
| 33 | + sock = nl_socket_alloc(); |
| 34 | if (!sock) { |
| 35 | nlmsg_free(msg); |
| 36 | return -1; |
| 37 | @@ -88,7 +88,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg |
| 38 | |
| 39 | /* To test connections and set the family */ |
| 40 | if (msg == NULL) { |
| 41 | - nl_handle_destroy(sock); |
| 42 | + nl_socket_free(sock); |
| 43 | sock = NULL; |
| 44 | return 0; |
| 45 | } |
| 46 | @@ -104,12 +104,12 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg |
| 47 | |
| 48 | nlmsg_free(msg); |
| 49 | |
| 50 | - nl_handle_destroy(sock); |
| 51 | + nl_socket_free(sock); |
| 52 | |
| 53 | return 0; |
| 54 | |
| 55 | fail_genl: |
| 56 | - nl_handle_destroy(sock); |
| 57 | + nl_socket_free(sock); |
| 58 | sock = NULL; |
| 59 | nlmsg_free(msg); |
| 60 | errno = err; |
| 61 | -- |
| 62 | 1.8.3.1 |
| 63 | |