[ovs-dev] [PATCH] netlink-socket: Fix broken build on Windows

Ben Pfaff blp at ovn.org
Mon Apr 2 16:34:48 UTC 2018


On Mon, Apr 02, 2018 at 02:24:36PM +0300, Alin Gabriel Serdean wrote:
> Skip network namespace id check on windows since we lack support
> and integration for their equivalent at the moment.
> 
> Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>

I find myself wondering whether this should be:

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index f3cce9314ebb..5234ca314008 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -747,6 +747,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, int *nsid, bool wait)
          * namespace (no id). Latest kernels return a valid ID only if
          * available or nothing. */
         netnsid_set_local(nsid);
+#ifndef _WIN32
         cmsg = CMSG_FIRSTHDR(&msg);
         while (cmsg != NULL) {
             if (cmsg->cmsg_level == SOL_NETLINK
@@ -771,6 +772,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, int *nsid, bool wait)
 
             cmsg = CMSG_NXTHDR(&msg, cmsg);
         }
+#endif
     }
 
     log_nlmsg(__func__, 0, buf->data, buf->size, sock->protocol);

so that *nsid gets initialized if nonnull.

Once you decided either way:

Acked-by: Ben Pfaff <blp at ovn.org>


More information about the dev mailing list