Skip to content

Commit 36a09c8

Browse files
flichtenheldcron2
authored andcommitted
dco: Change sd argument to dco_new_peer from int to socket_descriptor_t
Doesn't change anything for non-Win32 platforms. Change-Id: I28f856c1c156b54089d95b2e2539ecdb374cdd37 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Antonio Quartulli <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1195 Message-Id: <[email protected]> URL: https://sourceforge.net/p/openvpn/mailman/message/59238248/ Signed-off-by: Gert Doering <[email protected]>
1 parent 04d24fb commit 36a09c8

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

src/openvpn/dco.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,6 @@ dco_check_pull_options(msglvl_t msglevel, const struct options *o)
491491
return true;
492492
}
493493

494-
#if defined(__GNUC__) || defined(__clang__)
495-
#pragma GCC diagnostic push
496-
#pragma GCC diagnostic ignored "-Wconversion"
497-
#endif
498-
499494
int
500495
dco_p2p_add_new_peer(struct context *c)
501496
{
@@ -604,7 +599,7 @@ dco_multi_add_new_peer(struct multi_context *m, struct multi_instance *mi)
604599
int peer_id = c->c2.tls_multi->peer_id;
605600
struct sockaddr *remoteaddr, *localaddr = NULL;
606601
struct sockaddr_storage local = { 0 };
607-
int sd = c->c2.link_sockets[0]->sd;
602+
const socket_descriptor_t sd = c->c2.link_sockets[0]->sd;
608603

609604

610605
if (c->mode == CM_CHILD_TCP)
@@ -650,10 +645,6 @@ dco_multi_add_new_peer(struct multi_context *m, struct multi_instance *mi)
650645
return 0;
651646
}
652647

653-
#if defined(__GNUC__) || defined(__clang__)
654-
#pragma GCC diagnostic pop
655-
#endif
656-
657648
void
658649
dco_install_iroute(struct multi_context *m, struct multi_instance *mi, struct mroute_addr *addr)
659650
{

src/openvpn/dco_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dco_get_cipher(const char *cipher)
5959
* They are implemented by dco_linux.c
6060
*/
6161

62-
int dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr,
62+
int dco_new_peer(dco_context_t *dco, unsigned int peerid, socket_descriptor_t sd, struct sockaddr *localaddr,
6363
struct sockaddr *remoteaddr, struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6);
6464

6565
int dco_del_peer(dco_context_t *dco, unsigned int peerid);

src/openvpn/dco_win.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ dco_p2p_new_peer(HANDLE handle, OVERLAPPED *ov, struct link_socket *sock,
415415
}
416416

417417
int
418-
dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, struct sockaddr *localaddr,
418+
dco_new_peer(dco_context_t *dco, unsigned int peerid, socket_descriptor_t sd, struct sockaddr *localaddr,
419419
struct sockaddr *remoteaddr, struct in_addr *vpn_ipv4, struct in6_addr *vpn_ipv6)
420420
{
421-
msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd);
421+
msg(D_DCO_DEBUG, "%s: peer-id %d, fd " SOCKET_PRINTF, __func__, peerid, sd);
422422

423423
if (dco->ifmode == DCO_MODE_P2P)
424424
{

0 commit comments

Comments
 (0)