2 ####################### V 1.8.0.1 :
5 When no IP version was preferred by environment, option -4/-6, or
6 address option pf, Socat version 1.8.0.0 address TCP-LISTEN did not
7 accept TCP4 connections under BSD family operating systems, but only
8 TCP6. To regain previous behaviour, preferring IP version 4 is now the
9 default. This also fixes some other issues with bind and range options.
10 Thanks to Mike Andrews for reporting this issue.
11 Tests: LISTEN_4 LISTEN_6 V1800_*_RANGE V1800_*_BIND
13 Added Socat option -0 to allow version 1.8.0.0 behaviour (no preferred
16 UDP-SENDTO, UDPLITE-SENDTO, and IP-SENDTO addresses now select an IPv4
17 address in case the server name resolves to both IPv4 and IPv6
19 Tests: V1800_*_SENDTO_RESOLV_6_4
21 Guard applyopts_termios_value() with WITH_TERMIOS.
22 Thanks to Kush Upadhyay from Amazon Bottlerocket team for providing the
25 In some situations xioclose() was called nested what could cause hanging
26 of OpenSSL in pthread_rwlock_wrlock()
28 socat 1.8.0.0 with addresses of type RECVFROM and option fork, where
29 the second address failed to connect/open in the child process, entered
30 a fork loop that was only stopped by FD exhaustion caused by FD leak.
31 Test: RECVFROM_FORK_LOOP
33 socat 1.8.0.0 had an FD leak with addresses of type RECVFROM with fork.
34 Test: RECVFROM_FORK_LEAK
36 With version 1.8.0.0, options ipv6-join-group and ipv6-join-source-group
38 Thanks to Linus Luessing for reporting this bug.
40 IP-SENDTO and option pf (protocol-family) with protocol name (vs.numeric
41 argument) failed with message:
42 E retropts_int(): trailing garbage in numerical arg of option "protocol-family"
45 Fixed a possible buffer overrun with long log lines. In fact it does
46 not write beyond end of buffer but lets pass excessive data to the
48 Thanks to Heinrich Schuchardt from Canonical for reporting and sending
51 Reworked domain name resolution, centralized IPv4/IPv6 sorting.
53 Print warning about not checking CRLs in OpenSSL only in the first
57 Total inactivity timeout option -T 0 now means 0.0 seconds; up to
58 version 1.8.0.0 it meant no total inactivity timeout.
60 Changed socat-chain.sh, socat-mux.sh, and socat-broker.sh to work with
63 socat-mux.sh and socat-broker.sh, when run as root, now internally use
64 low (512..1023) UDP ports to increase security.
66 Added option ai-all (sets AI_ALL flag of getaddrinfo() resolver)
68 Socks5 now also allows syntax without socks port, and supports option
72 Changes for building and testing on NetBSD
74 New Linux distributions dislike egrep, fgrep
76 When NETDB_INTERNAL is not available it should be set to -1.
77 Thanks to Baruch Siach for sending a patch.
79 On OpenSolaris/Illumos, isastream() is declared only in stropts.h, not
81 Thanks to Andy Fiddaman for sending a patch.
83 On latest Illumos, compilation failed due to new unexpected SO_PROTOCOL
85 Thanks to Andy Fiddaman for sending a patch.
88 Makefile.in: procan.o build requires srcdir prefix for explicit source
90 Thanks to Hongxu Jia and Andrew Schoolman for providing patches.
92 Makefile.in: the CC define for procan.o build failed when CC had more
94 Thanks to Hongxu Jia for providing an inital patch.
97 Added the optional DEVTESTS feature for developer tests with controlled
98 name resolution to both IPv4 and IPV6 addresses: configure Socat with
99 --enable-devtests, this provides internal resolution of domain
100 dest-unreach.net with host names: localhost-4, localhost-6,
101 localhost-4-6, and localhost-6-4
103 test.sh: lots of corrections and improvements
105 test.sh: many hardcoded sleep values were replaced by much shorter
106 values tuned to performance of the platform.
108 test.sh -D for output of platform/system specific defines (variables)
110 test.sh: fixed ss determination; more DEFS
113 Fixed a lot of typos.
114 Thanks to Solomon Victorino for sending the patch.
116 ####################### V 1.8.0.0:
119 Socats OpenSSL addresses do not (and never did) check certificate
120 revocation lists (CRLs). Socat now prints a warning about this.
123 Added the --experimental option that enables use of features that might
124 change in the future.
126 Now warning messages are printed by default. If you want to see only
127 errors and fatals as in previous versions, use option -d0;
128 option -d4 is equivalent to -dddd and to -d -d -d -d
129 The number of warnings has been reduced, e.g.removing a non existing
130 file does in most cases no longer log a warning.
132 Added address type internal SOCKETPAIR. This is similar to the unnamed
133 PIPE address (only for internal echoing) but it provides datagram mode
134 (the default) and thus keeps packet boundaries.
135 Tests: SOCKETPAIR_STREAM SOCKETPAIR_DATAGRAM SOCKETPAIR_SEQPACKET
136 SOCKETPAIR_BOUNDARIES
138 New option -S <mask> controls catching and logging of signals that are
139 not internally used by Socat.
140 Tests: SIGTERM_NOLOG SIG31_LOG
142 Added option ipv6-join-source-group.
143 Thanks to Martin Buck and David Schweizer for sending patches.
145 Added option http-version to PROXY-CONNECT address to support servers
146 that are not able to handle HTTP version 1.0
147 Test: PROXY_HTTPVERSION
148 Feature inspired by Robin Palotai.
150 New options openssl-maxfraglen and openssl-maxsendfrag for
151 functions/macros SSL_CTX_set_tlsext_max_fragment_length() and
152 SSL_CTX_set_max_send_fragment().
153 Thanks to James Tavares for his contribution.
155 Added Info log of resulting OpenSSL max fragment length.
157 Implemented options rcvtimeo and sndtimeo, the first of which may be
158 useful to prevent endlessly hanging DTLS connection etablishment.
160 Feature proposed by Vladimir Nikishkin.
162 The file names with -r and -R now may contain environment variable
164 Test: VARS_IN_SNIFFPATH
166 Socat option --statistics logs final byte and packet counter values
167 before exit. Signal USR1 logs actual values.
168 Tests: OPTION_STATISTICS SIGUSR1_STATISTICS
170 Added option sitout-eio to specify a timerange in which EIO on the pty
171 of a sub process is tolerated.
172 Red Hat issue 1853102 related.
173 Thanks to Jonathan Casiot for sending an initial patch.
175 Socat now installs as socat1 and is referenced by symbolic link socat,
176 same with man page (socat1.1 by socat.1)
178 New option children-shutup[=1|2...] decreases severity of log
179 messages in LISTEN and CONNECT type sub processes.
180 Test: CHILDREN_SHUTUP
182 New option retrieve-vlan for supporting VLANs in INTERFACE addresses:
183 Linux normally keeps VLAN tags in outgoing raw packets, but appears to
184 strip them from incoming packets and makes them available in
185 PACKET_AUXDATA ancillary messages only.
186 Up do version 1.7.4.5 Socat did not handle this situation, so the VLAN
187 tags where effectively stripped off incoming packets.
188 With this option Socat restores the VLAN tag.
189 Feature inspired by Zhao Dong.
191 Socket option SO_REUSEADDR is now automatically applied to TCP LISTEN
192 addresses. reuseaddr= restores the old behaviour.
193 Tests: TCP4_REUSEADDR OPENSSL_6_REUSEADDR REUSEADDR_NULL
195 TCP based client addresses now try all results of name resolution until
196 a connection attempt succeeded.
197 Tests: TRY_ADDRS_4 TRY_ADDRS_4_6
198 Feature recommended by Anand Buddhdev.
200 configure option --enable-default-ipv allows to specify at build time if
201 IPv4, IPv6, or none of these is the preferred default; this is related
202 to environment variables SOCAT_PREFERRED_RESOLVE_IP and
203 SOCAT_DEFAULT_LISTEN_IP, and to Socat option -4, -6.
204 Furthermore, mechanism of IPv4 vs.IPv6 selection has been reworked.
205 When no IP version is preferred by these mechanism, passive Socat
206 addresses (LISTEN, RECV, RECVFROM) default to IPv6 because it might
207 support both versions (but checkout option ipv6-v6only).
208 For client addresses, when one of these mechanisms applies and name
209 resolution gives addresses of both IP versions, the addresses of the
210 preferred versions are tried first.
212 New option ai-addrconfig sets or unsets the AI_ADDRCONFIG flag of the
213 resolver to prevent name resolution to address families that are not
214 available in the network configuration. Default value is 1 in case the
215 resolver does not get an address family hint.
217 Flag AI_PASSIVE is now automatically applied for LISTEN, RECV, and
218 RECVFROM type addresses, and with bind option. In addition to its
219 application to the getaddrinfo() function, when this flag is set while
220 no IP version is preferred by build, environment, option, or address
221 type, Socat chooses IPv6 because this might activate both versions (but
222 check option ipv6-v6only).
223 Added option ai-passive to control this flag explicitely.
225 New option ai-v4mapped (v4mapped) sets or unsets the AI_V4MAPPED flag
226 of the resolver. For Socat addresses requiring IPv6 addresses, this
227 resolves IPv4 addresses to the approriate IPv6 address [::ffff:*:*].
229 DNS resolver Options (res-*) are now set for the complete open phase of
230 the address, not per getaddrinfo() invocation.
232 Added the netns option that tries to open an address in the given
234 Tests: NETNS NETNS_EXEC
236 New address ACCEPT-FD (ACCEPT) expects a listening file descriptor
237 passed from parent, and accepts one or more connections for data
238 transfer. This can be used with "inetd mode" of systemd.
241 Added experimental socks5 TCP client support (connect,bind); syntax:
242 SOCKS5-CONNECT:<socks-server>:<socks-port>:<target-host>:<target-port>
243 SOCKS5-LISTEN:<socks-server>:<socks-port>:<listen-host>:<listen-port>
244 Thanks to Charlie Svensson and others for contributions.
246 New address types POSIXMQ-RECEIVE, POSIXMQ-READ, POSIXMQ-SEND, and
247 POSIXMQ-BIDIRECTIONAL (Linux only, experimental), and option
249 Tests: LINUX_POSIXMQ_READ_PRIO LINUX_POSIXMQ_RECV_FORK
250 LINUX_POSIXMQ_RECV_MAXCHILDREN LINUX_POSIXMQ_SEND_MAXCHILDREN
252 New address SHELL invokes a shell but without the overhead of SYSTEM
254 Added options res-retrans and res-retry that make use of undocumented
255 resolver variables to set the retransmission time interval resp.the
256 number of times to retransmit.
257 Disable them and the old res-* opts with: ./configure --disable-resolve
259 Added option res-nsaddr that overrides /etc/resolv.conf nameserver
260 address based on an undocumented resolver feature.
262 New option chdir changes the working directory of the address to the
263 given path, only during the open stage.
264 Tests: CHDIR_ON_CREATE CHDIR_ON_SYSTEM
266 Option umask now applies only during opening of its very address, not
267 for the lifetime of the process; the original umask is restored
269 Tests: UMASK_ON_CREATE UMASK_ON_SYSTEM
271 Added option unix-bind-tempname (bind-tempname) to allow UNIX (and
272 ABSTRACT) client addresses to bind to unique addresses even when
273 invoked in forked off sub processes.
274 Tests: UNIX_LISTEN_CONNECT_BIND_TEMPNAME UNIX_LISTEN_CLIENT_BIND_TEMPNAME
275 UNIX_RECVFROM_CLIENT_BIND_TEMPNAME UNIX_RECVFROM_SENDTO_BIND_TEMPNAME
276 ABSTRACT_LISTEN_CONNECT_BIND_TEMPNAME ABSTRACT_LISTEN_CLIENT_BIND_TEMPNAME
277 ABSTRACT_RECVFROM_CLIENT_BIND_TEMPNAME ABSTRACT_RECVFROM_SENDTO_BIND_TEMPNAME
278 Thanks to Kai Lüke for sending an initial patch.
280 New option f-setpipe-sz (pipesz) sets the pipe size on systems that
281 provide ioctl F_SETIPE_SZ.
282 Filan prints the current value.
283 Tests: STDIN_F_SETPIPE_SZ EXEC_F_SETPIPE_SZ
285 Bidirectional PIPE addresses may block on writing a data chunk larger
286 than pipe buffer. Socat now tries to detect if transfer block size is
287 large enough and issues a warning.
289 Added direct support of DCCP protocol, new addresses:
292 DCCP4-CONNECT (DCCP4)
293 DCCP4-LISTEN (DCCP4-L)
294 DCCP6-CONNECT (DCCP6)
295 DCCP6-LISTEN (DCCP6-L)
296 New option: dccp-set-ccid (ccid)
298 Support for UDP-Lite protocol, new addresses:
305 All these are also available in UDPLITE4-* and UDPLITE6-* form;
306 options udplite-recv-cscov and udplite-send-cscov.
308 Procan now prints info about CC and __STDC_VERSION__, about FD_SETSIZE,
309 value of SO_PROTOCOL/SO_PROTOTYPE and some other defines, definitions
310 of many C types, and the actual umask.
312 Procan tries to find the name of the controlling terminal, on Linux it
313 reads info from /proc/self/stat and searches for a device with matching
314 major and minor numbers.
316 Added socat-chain.sh that makes it possible to stack protocols, e.g. to
317 drive socks through TLS, or to use TLS over a serial line.
318 Tests: SOCAT_CHAIN_SOCKS4 SOCAT_CHAIN_SSL_PTY
320 Added script socat-mux.sh that performs n-to-1 / 1-to-n communications
321 using two Socat instances with multicasting.
325 When a sub process (EXEC, SYSTEM) terminated with exit code other than
326 0, its last sent data might have been lost depending on timing of read/
327 write and SIGCHLD in Socat.
328 Now the SIGCHLD handler does not simply terminate Socat in this case,
329 but remembers the failure and allows further processing.
330 Thanks to Luke Jones for reporting this issue.
332 Now catching the case of empty SNI host to prevent OpenSSL error.
333 This is related to Red Hat issue 2081414.
335 Better formatted help output; address keywords in help output are now
336 printed in uppercase.
338 In previous Socat versions errors EPIPE and ECONNRESET on read() were
339 handled at warning level, thus not automatically leading to termination
340 with exit code 1. Beginning with this release these conditions are
341 handled as errors with termination and exit code 1 to not pretend
342 success on possible data loss.
343 Problem reported by Scott Burkett.
345 In previous Socat versions errors on shutdown() were ignored (info
347 Now Socat handles EPIPE and ECONNRESET as errors to indicate possible
348 failure of data transfer.
350 INTERFACE addresses did not accept options of INTERFACE group (for
351 historical reasons they were only available with TUN addresses).
353 Opening addresses did not check if they support all directions expected
354 by Socat. Now an error is printed when, e.g,, a read-only type address
355 is opened for writing.
357 A lot of minor corrections, e.g., catch readline() errors in filan,
358 detect byte order in procan
361 OpenSSL cipherlist option did not override global openssl.cnf settings.
362 Now SSL_CTX_set_cipher_list() is called before
363 SSL_CTX_use_certificate_chain_file().
364 Thanks to Hiroshi Sakurai for reporting the problem and suggesting this
367 Fixed option sourceport with UDP6-DATAGRAM.
369 Some client addresses (e.g. TCP-CONNECT) take the fork option for
370 automatically spawning new connections, however the max-children option
373 Fixed the end-close option, it just did not work.
375 In configure.ac was a direct call to gcc instead of $CC which broke
377 Thanks to Fergus Dall for sending a patch.
380 Introduced groups_t instead of uint32_t, for more flexibility.
382 Rearranged option group bits to only require 32 bits on older systems.
384 Make gcc happy, replace strncat with "manual" copying
386 On addresses like UDP-RECVFROM with fork option every packet causes a
387 new child process which then reads the packet. The parent process must
388 wait until the packet has been read before checking again. The former
389 synchronization mechanism using SIGUSR1 is now replaced by a
390 socketpair. SIGUSR1 is no longer used for internal synchronization.
391 Tests: UDP4_FORK UDP6_FORK UNIX_FORK
393 Renamed xioopts_t to xioparms_t to avoid confusion with xioopts module.
395 Moved multicast related code from xioopts.c to xio-ip.c and xio-ip6.c
397 Pointers of type struct single are now always called sfd.
400 Removed Config/ because its contents have not been maintained for many
403 Try to not receive outgoing packets on raw (PF_PACKET) sockets - use
404 PACKET_IGNORE_OUTGOING socket options when available.
405 Test: INTERFACE_IGNOREOUTGOING
407 Renewed port to OpenBSD:
408 Guard OPENSSL_INIT_SETTINGS; and minor changes.
410 Thanks to Paul Hunt for sending a fix of the configure
411 --enable-openssl-base processing.
413 Enable direct largefile support on "smaller" systems per
414 _FILE_OFFSET_BITS and _LARGE_FILES.
415 Thanks to Fergus Dall for sending a patch.
417 Some corrections for better 32bit systems support.
420 Removed obselete parts from test.sh
422 test.sh: Introduced function checkcond
424 Renamed test.sh option -foreign to -internet
427 Removed obselete file doc/xio.help
429 Added doc for option ipv6-join-group (ipv6-add-membership)
430 Thanks to Martin Buck for sending the patch.
432 Renamed xiogetpacketsrc() to xiogetancillary()
434 On bad parameter number now print syntax.
436 ####################### V 1.7.4.5 (not released):
439 On connect() failure and in some other situations Socat tries to get
440 detailled information about the error with recvmsg(). Error return of
441 this function is now logged as Info instead of Warn.
443 Tests of the correction of the "IP_ADD_SOURCE_MEMBERSHIP but not struct
444 ip_mreq_source" issue left an #undef in xiosysincludes.h that disabled
445 the ip-add-source-membership option.
446 Thanks to Benjamin Poirier for sending a patch.
448 Fixed a bug in dalan module that caused SIGSEGV in, e.g.,
449 SOCKET-LISTEN:1:1:'"/tmp/sock"'
450 Test: DALAN_NO_SIGSEGV
452 The retry option with some address types (TCP) did not close() the
453 sockets after failed attempts, resulting in an FD leak.
455 Filan: Corrected some syntax error messages
457 Filan: Fixed a bug introduced in 1.7.4.4 that broke displaying
458 TCP/UDP on options -s, -S
459 Test: FILAN_SHORT_TCP
461 Filan: If IP protocol type cannot be retrieved, display at least the
464 Filan: Fixed diag_set() call in filan_main.c, bug popped up with C23.
465 Thanks to Cristian Rodríguez from openSUSE for reporting this issue.
467 Querying the vsock Context Identifier (CID) requires an FD from opening
469 Thanks to Volker Simonis for sending a patch.
471 Fixed an internal FD leak in the EXEC,SYSTEM addresses.
473 The FDs of the socketpair that queues messages from signal handlers
474 lacked FD_CLOEXEC and thus leaked into EXEC and SYSTEM child processes.
476 Option stderr on addresses EXEC and SYSTEM uses a temporary FD. It
477 lacked the FD_CLOEXEC setting and thus leakt into child processes.
479 Restoring of STDIO tty settings failed on Solaris type operating
481 Thanks to Gordon W.Ross for reporting and fixing this issue.
484 The OpenSSL client SNI parameter, when not explicitely specified, is
485 derived from option commonname or rom target server name. This is not
486 useful with IP addresses, which Socat now checks and avoids.
488 Socat options -L and -W create lock files using mkstemp(), so they had
489 permissions 600. There does not seem to be a good reason for this
490 restrictive mode. Furthermore Silla Rizzoli experienced that Minicom
491 ignores lock files with mode 600, so it is set to 644 now.
493 Procan tries to find out VSOCK CID only when running as root
495 The mechanism for deferring logs from signal handlers had an issue that
496 caused lots of unwanted recvfrom() calls.
498 Do not try to remove abstract UNIX socket entries after use.
501 VSOCK, VSOCK-L support options pf, socktype, prototype (currently
505 New Environment variable SOCAT_TRANSFER_WAIT that Socat sleep before
506 starting the data transfer loop. Useful, e.g., to accumulate multiple
507 packets in a receiving datagram socket before starting to process them.
509 "//" comments were used for disabling experimental code. These lines
510 have now been removed or disabled in other ways to make Socat compile
511 with C89/C90 standard again.
513 fcntl() trace prints flags now in hexadecimal.
515 Stream dump options -r and -R now open their pathes with CLOEXEC to
516 prevent leaking into sub processes.
519 Stream dump write now warn on write errors and partial writes (but
520 still do not recover).
522 Removed trailing white space from *.h and *.c files.