[ovs-dev] [PATCH v2] netlink-socket.c: fix typo to get_sock_pid_from_kernel()

Nithin Raju nithin at vmware.com
Wed Aug 27 03:20:51 UTC 2014


A typo crept in while respinning get_sock_pid_from_kernel() in the previous
patch. Fixing it now. Also, get_sock_pid_from_kernel() doesn't need an OUT
argument. Fixing that too.

Signed-off-by: Nithin Raju <nithin at vmware.com>
---
 lib/netlink-socket.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 2a90197..4d9832f 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -72,7 +72,7 @@ static uint32_t nl_sock_allocate_seq(struct nl_sock *, unsigned int n);
 static void log_nlmsg(const char *function, int error,
                       const void *message, size_t size, int protocol);
 #ifdef _WIN32
-static int get_sock_pid_from_kernel(struct nl_sock *sock, uint32_t *pid);
+static int get_sock_pid_from_kernel(struct nl_sock *sock);
 #endif
 
 /* Netlink sockets. */
@@ -165,7 +165,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp)
     rcvbuf = 1024 * 1024;
 #ifdef _WIN32
     sock->rcvbuf = rcvbuf;
-    retval = get_sock_pid_from_kernel(sock, &sock->pid);
+    retval = get_sock_pid_from_kernel(sock);
     if (retval != 0) {
         goto error;
     }
@@ -261,7 +261,7 @@ nl_sock_destroy(struct nl_sock *sock)
  * follows a transaction semantic. Eventually this function should call into
  * nl_transact. */
 static int
-get_sock_pid_from_kernel(struct nl_sock *sock, uint32_t *pid)
+get_sock_pid_from_kernel(struct nl_sock *sock)
 {
     struct nl_transaction txn;
     struct ofpbuf request;
@@ -303,12 +303,12 @@ get_sock_pid_from_kernel(struct nl_sock *sock, uint32_t *pid)
             goto done;
         }
 
-        nlmsg = nl_msg_nlmsghdr(txn.request);
+        nlmsg = nl_msg_nlmsghdr(txn.reply);
         if (nlmsg->nlmsg_seq != seq) {
             retval = EINVAL;
             goto done;
         }
-        *pid = nlmsg->nlmsg_pid;
+        sock->pid = nlmsg->nlmsg_pid;
     }
     retval = 0;
 
-- 
1.7.4.1




More information about the dev mailing list