[ovs-dev] [PATCH] socket-util: Avoid using sendmsg on Windows

Shashank Ram rams at vmware.com
Thu Jul 13 21:03:44 UTC 2017





________________________________________
From: ovs-dev-bounces at openvswitch.org <ovs-dev-bounces at openvswitch.org> on behalf of Alin Serdean <aserdean at cloudbasesolutions.com>
Sent: Thursday, July 13, 2017 1:54 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH] socket-util: Avoid using sendmsg on Windows

Sendmsg is not used under Windows.

While it does have a sort of equivalent called `WSASendMsg`
it uses a different structure `WSAMSG` instead of the normal msghdr which
in turn will have to be mapped properly (this goes further to iovec/wsabuf in the
structure itself).

Fixes broken build on Windows.

Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
 lib/socket-util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 7148ae3..de7df67 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -1021,6 +1021,7 @@ sock_strerror(int error)
 #endif
 }

+#ifndef _WIN32 //Avoid using sendmsg on Windows entirely
 static int
 emulate_sendmmsg(int fd, struct mmsghdr *msgs, unsigned int n,
                  unsigned int flags)
@@ -1058,3 +1059,4 @@ wrap_sendmmsg(int fd, struct mmsghdr *msgs, unsigned int n, unsigned int flags)
     return emulate_sendmmsg(fd, msgs, n, flags);
 }
 #endif
+#endif
--
2.10.2.windows.1
_______________________________________________

Acked-by: Shashank Ram <rams at vmware.com>



More information about the dev mailing list