summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/network.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/network.c b/src/core/network.c
index bf7fbb97..f0503f32 100644
--- a/src/core/network.c
+++ b/src/core/network.c
@@ -182,10 +182,8 @@ GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip)
#ifndef WIN32
fcntl(handle, F_SETFL, O_NONBLOCK);
#endif
- setsockopt(handle, SOL_SOCKET, SO_REUSEADDR,
- (char *) &opt, sizeof(opt));
- setsockopt(handle, SOL_SOCKET, SO_KEEPALIVE,
- (char *) &opt, sizeof(opt));
+ setsockopt(handle, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+ setsockopt(handle, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt));
/* set our own address */
if (my_ip != NULL) {
@@ -293,10 +291,8 @@ GIOChannel *net_listen(IPADDR *my_ip, int *port)
#ifndef WIN32
fcntl(handle, F_SETFL, O_NONBLOCK);
#endif
- setsockopt(handle, SOL_SOCKET, SO_REUSEADDR,
- (char *) &opt, sizeof(opt));
- setsockopt(handle, SOL_SOCKET, SO_KEEPALIVE,
- (char *) &opt, sizeof(opt));
+ setsockopt(handle, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+ setsockopt(handle, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt));
/* specify the address/port we want to listen in */
ret = bind(handle, &so.sa, SIZEOF_SOCKADDR(so));