Options so-rcvtimeo and so-sndtimeo do not work with poll()

This commit is contained in:
Gerhard Rieger 2017-01-08 11:12:57 +01:00
parent 40f6fa29e1
commit 9f41543aad
6 changed files with 4 additions and 30 deletions

View file

@ -39,6 +39,10 @@ corrections:
Test: UDP4MAXCHILDREN UDP6MAXCHILDREN
Thanks to Leander Berwers for reporting this issue.
Options so-rcvtimeo and so-sndtimeo do not work with poll()/select()
and therefore were useless.
Thanks to Steve Borenstein for reporting this issue.
porting:
Type conflict between int and sig_atomic_t between declaration and
definition of diag_immediate_type and diag_immediate_exit broke

View file

@ -1850,8 +1850,6 @@ label(OPTION_RCVBUF_LATE)dit(bf(tt(rcvbuf-late=<bytes>)))
label(OPTION_RCVLOWAT)dit(bf(tt(rcvlowat=<bytes>)))
Specifies the minimum number of received bytes [link(int)(TYPE_INT)] until
the socket layer will pass the buffered data to socat().
label(OPTION_RCVTIMEO)dit(bf(tt(rcvtimeo=<seconds>)))
Sets the receive timeout [link(timeval)(TYPE_TIMEVAL)].
label(OPTION_REUSEADDR)dit(bf(tt(reuseaddr)))
Allows other sockets to bind to an address even if parts of it (e.g. the
local port) are already in use by socat() (link(example)(EXAMPLE_OPTION_REUSEADDR)).
@ -1864,8 +1862,6 @@ label(OPTION_SNDBUF_LATE)dit(bf(tt(sndbuf-late=<bytes>)))
label(OPTION_SNDLOWAT)dit(bf(tt(sndlowat=<bytes>)))
Specifies the minimum number of bytes in the send buffer until the socket
layer will send the data to <bytes> [link(int)(TYPE_INT)].
label(OPTION_SNDTIMEO)dit(bf(tt(sndtimeo=<seconds>)))
Sets the send timeout to seconds [link(timeval)(TYPE_TIMEVAL)].
label(OPTION_PROTOCOL_FAMILY)dit(bf(tt(pf=<string>)))
Forces the use of the specified IP version or protocol. <string> can be
something like "ip4" or "ip6". The resulting value is

View file

@ -512,12 +512,6 @@ filloptionvalues() {
*,linger,*) OPTS=$(echo "$OPTS" |sed "s/,linger,/,linger=2,/g");;
esac
case "$OPTS" in
*,rcvtimeo,*) OPTS=$(echo "$OPTS" |sed "s/,rcvtimeo,/,rcvtimeo=1,/g");;
esac
case "$OPTS" in
*,sndtimeo,*) OPTS=$(echo "$OPTS" |sed "s/,sndtimeo,/,sndtimeo=1,/g");;
esac
case "$OPTS" in
*,connect-timeout,*) OPTS=$(echo "$OPTS" |sed "s/,connect-timeout,/,connect-timeout=1,/g");;
esac
# IP

View file

@ -103,15 +103,9 @@ const struct optdesc opt_so_dontroute= { "so-dontroute", "dontroute", OPT_SO_DON
#ifdef SO_RCVLOWAT
const struct optdesc opt_so_rcvlowat = { "so-rcvlowat", "rcvlowat", OPT_SO_RCVLOWAT, GROUP_SOCKET, PH_PASTSOCKET, TYPE_INT, OFUNC_SOCKOPT, SOL_SOCKET, SO_RCVLOWAT };
#endif
#ifdef SO_RCVTIMEO
const struct optdesc opt_so_rcvtimeo = { "so-rcvtimeo", "rcvtimeo", OPT_SO_RCVTIMEO, GROUP_SOCKET, PH_PASTSOCKET, TYPE_TIMEVAL,OFUNC_SOCKOPT,SOL_SOCKET,SO_RCVTIMEO };
#endif
#ifdef SO_SNDLOWAT
const struct optdesc opt_so_sndlowat = { "so-sndlowat", "sndlowat", OPT_SO_SNDLOWAT, GROUP_SOCKET, PH_PASTSOCKET, TYPE_INT, OFUNC_SOCKOPT, SOL_SOCKET, SO_SNDLOWAT };
#endif
#ifdef SO_SNDTIMEO
const struct optdesc opt_so_sndtimeo = { "so-sndtimeo", "sndtimeo", OPT_SO_SNDTIMEO, GROUP_SOCKET, PH_PASTSOCKET, TYPE_TIMEVAL,OFUNC_SOCKOPT,SOL_SOCKET,SO_SNDTIMEO };
#endif
/* end of setsockopt options of UNIX98 standard */
#ifdef SO_AUDIT /* AIX 4.3.3 */

View file

@ -35,9 +35,7 @@ extern const struct optdesc opt_so_error;
extern const struct optdesc opt_so_type;
extern const struct optdesc opt_so_dontroute;
extern const struct optdesc opt_so_rcvlowat;
extern const struct optdesc opt_so_rcvtimeo;
extern const struct optdesc opt_so_sndlowat;
extern const struct optdesc opt_so_sndtimeo;
extern const struct optdesc opt_so_audit;
extern const struct optdesc opt_so_attach_filter;
extern const struct optdesc opt_so_detach_filter;

View file

@ -1202,9 +1202,6 @@ const struct optname optionnames[] = {
IF_SOCKET ("rcvbuf-late", &opt_so_rcvbuf_late)
#ifdef SO_RCVLOWAT
IF_SOCKET ("rcvlowat", &opt_so_rcvlowat)
#endif
#ifdef SO_RCVTIMEO
IF_SOCKET ("rcvtimeo", &opt_so_rcvtimeo)
#endif
IF_OPEN ("rdonly", &opt_o_rdonly)
IF_OPEN ("rdwr", &opt_o_rdwr)
@ -1374,9 +1371,6 @@ const struct optname optionnames[] = {
#ifdef SO_SNDLOWAT
IF_SOCKET ("sndlowat", &opt_so_sndlowat)
#endif
#ifdef SO_SNDTIMEO
IF_SOCKET ("sndtimeo", &opt_so_sndtimeo)
#endif
#ifdef SO_ACCEPTCONN /* AIX433 */
IF_SOCKET ("so-acceptconn", &opt_so_acceptconn)
#endif /* SO_ACCEPTCONN */
@ -1436,9 +1430,6 @@ const struct optname optionnames[] = {
IF_SOCKET ("so-rcvbuf-late", &opt_so_rcvbuf_late)
#ifdef SO_RCVLOWAT
IF_SOCKET ("so-rcvlowat", &opt_so_rcvlowat)
#endif
#ifdef SO_RCVTIMEO
IF_SOCKET ("so-rcvtimeo", &opt_so_rcvtimeo)
#endif
IF_SOCKET ("so-reuseaddr", &opt_so_reuseaddr)
#ifdef SO_REUSEPORT /* AIX 4.3.3 */
@ -1458,9 +1449,6 @@ const struct optname optionnames[] = {
#ifdef SO_SNDLOWAT
IF_SOCKET ("so-sndlowat", &opt_so_sndlowat)
#endif
#ifdef SO_SNDTIMEO
IF_SOCKET ("so-sndtimeo", &opt_so_sndtimeo)
#endif
#ifdef SO_TIMESTAMP
IF_SOCKET ("so-timestamp", &opt_so_timestamp)
#endif