aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Lichtenheld2023-02-03 20:14:40 +0100
committerGert Doering2023-02-25 17:50:25 +0100
commite9ae7cee2ca9b9ab78de01f1d3c562610e5624d2 (patch)
tree52fc53d1e24bd633b44f0bfe7374cdc05c2d8820
parent094aea56ce20d0bb6fe79e6e14a3dfe68ea11786 (diff)
downloadopenvpn-e9ae7cee2ca9b9ab78de01f1d3c562610e5624d2.zip
openvpn-e9ae7cee2ca9b9ab78de01f1d3c562610e5624d2.tar.gz
Windows: fix signedness errors with recv/send
On Linux those functions actually take void pointer, so no behavior change there. On Windows, we avoid warnings about unsigned char vs char. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20230203191440.136050-6-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26144.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 7acd93a6bef2dd9b660571c29b5f41c8ca351161)
-rw-r--r--src/openvpn/manage.c4
-rw-r--r--src/openvpn/proxy.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index a55e5d7..db88e34 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -2255,7 +2255,7 @@ man_read(struct management *man)
man->connection.lastfdreceived = fd;
}
#else /* ifdef TARGET_ANDROID */
- len = recv(man->connection.sd_cli, buf, sizeof(buf), MSG_NOSIGNAL);
+ len = recv(man->connection.sd_cli, (void *)buf, sizeof(buf), MSG_NOSIGNAL);
#endif
if (len == 0)
@@ -2352,7 +2352,7 @@ man_write(struct management *man)
}
else
#endif
- sent = send(man->connection.sd_cli, BPTR(buf), len, MSG_NOSIGNAL);
+ sent = send(man->connection.sd_cli, (const void *)BPTR(buf), len, MSG_NOSIGNAL);
if (sent >= 0)
{
buffer_list_advance(man->connection.out, sent);
diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c
index aa10363..ed47eaa 100644
--- a/src/openvpn/proxy.c
+++ b/src/openvpn/proxy.c
@@ -126,7 +126,7 @@ recv_line(socket_descriptor_t sd,
}
/* read single char */
- size = recv(sd, &c, 1, MSG_NOSIGNAL);
+ size = recv(sd, (void *)&c, 1, MSG_NOSIGNAL);
/* error? */
if (size != 1)