diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-02-27 21:23:14 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-02-27 21:23:14 +0000 |
commit | 0e05ac80ccace355b049c32f61225576723d4653 (patch) | |
tree | 433272ad5ad77ed35dd0e306bf3b81a6799b8bcd | |
parent | bd7cf4601d2cfa70b41c749f3889aeec64d4e045 (diff) |
remove unneeded casts in [gs]etsockopt(); ok markus@
-rw-r--r-- | usr.bin/ssh/canohost.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/channels.c | 9 | ||||
-rw-r--r-- | usr.bin/ssh/packet.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/sshd.c | 10 |
4 files changed, 14 insertions, 15 deletions
diff --git a/usr.bin/ssh/canohost.c b/usr.bin/ssh/canohost.c index a19fa1f0571..65342e935d2 100644 --- a/usr.bin/ssh/canohost.c +++ b/usr.bin/ssh/canohost.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: canohost.c,v 1.30 2002/01/29 14:32:03 markus Exp $"); +RCSID("$OpenBSD: canohost.c,v 1.31 2002/02/27 21:23:13 stevesk Exp $"); #include "packet.h" #include "xmalloc.h" @@ -132,7 +132,7 @@ check_ip_options(int socket, char *ipaddr) else ipproto = IPPROTO_IP; option_size = sizeof(options); - if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options, + if (getsockopt(socket, ipproto, IP_OPTIONS, options, &option_size) >= 0 && option_size != 0) { text[0] = '\0'; for (i = 0; i < option_size; i++) diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index abe83e0ca9c..322d9453d06 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.169 2002/02/24 19:59:42 stevesk Exp $"); +RCSID("$OpenBSD: channels.c,v 1.170 2002/02/27 21:23:13 stevesk Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1184,8 +1184,7 @@ channel_post_connecting(Channel *c, fd_set * readset, fd_set * writeset) socklen_t sz = sizeof(err); if (FD_ISSET(c->sock, writeset)) { - if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, (char *)&err, - &sz) < 0) { + if (getsockopt(c->sock, SOL_SOCKET, SO_ERROR, &err, &sz) < 0) { err = errno; error("getsockopt SO_ERROR failed"); } @@ -2036,10 +2035,10 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por * Set socket options. We would like the socket to disappear * as soon as it has been closed for whatever reason. */ - setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); linger.l_onoff = 1; linger.l_linger = 5; - setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger)); + setsockopt(sock, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); debug("Local forwarding listening on %s port %s.", ntop, strport); /* Bind the socket to the address. */ diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index d8c48b66ecf..b3e6d8493e7 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.89 2002/02/24 16:58:32 markus Exp $"); +RCSID("$OpenBSD: packet.c,v 1.90 2002/02/27 21:23:13 stevesk Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -1215,7 +1215,7 @@ packet_set_interactive(int interactive) */ if (packet_connection_is_ipv4()) { if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, - (void *) &lowdelay, sizeof(lowdelay)) < 0) + &lowdelay, sizeof(lowdelay)) < 0) error("setsockopt IPTOS_LOWDELAY: %.100s", strerror(errno)); } @@ -1225,7 +1225,7 @@ packet_set_interactive(int interactive) * Set IP options for a non-interactive connection. Use * IPTOS_THROUGHPUT. */ - if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *) &throughput, + if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, &throughput, sizeof(throughput)) < 0) error("setsockopt IPTOS_THROUGHPUT: %.100s", strerror(errno)); } diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index a8abf4e17c4..eca004fa092 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.227 2002/02/24 16:09:52 stevesk Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.228 2002/02/27 21:23:13 stevesk Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -874,11 +874,11 @@ main(int ac, char **av) * close. */ setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, - (void *) &on, sizeof(on)); + &on, sizeof(on)); linger.l_onoff = 1; linger.l_linger = 5; setsockopt(listen_sock, SOL_SOCKET, SO_LINGER, - (void *) &linger, sizeof(linger)); + &linger, sizeof(linger)); debug("Bind to port %s on %s.", strport, ntop); @@ -1122,11 +1122,11 @@ main(int ac, char **av) /* setsockopt(sock_in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */ linger.l_onoff = 1; linger.l_linger = 5; - setsockopt(sock_in, SOL_SOCKET, SO_LINGER, (void *) &linger, sizeof(linger)); + setsockopt(sock_in, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger)); /* Set keepalives if requested. */ if (options.keepalives && - setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, + setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0) error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno)); |