Skip to content

sockopts: support many more socket options, including strings#514

Open
robbat2 wants to merge 1 commit into
RsyncProject:masterfrom
robbat2:sockopts
Open

sockopts: support many more socket options, including strings#514
robbat2 wants to merge 1 commit into
RsyncProject:masterfrom
robbat2:sockopts

Conversation

@robbat2

@robbat2 robbat2 commented Aug 20, 2023

Copy link
Copy Markdown

Add support for many more socket options, including those that take string inputs, such as TCP_CONGESTION=bbr.

Options known to the code, but not present at build time will now emit an error that is distict from options unknown to the code (unknown vs not-available).

This patch greatly eases running specific rsync configurations, without relying on LD_PRELOAD to modify socket behaviors.

@robbat2 robbat2 force-pushed the sockopts branch 4 times, most recently from 2f9a1e9 to 073a65d Compare August 20, 2023 23:53
@robbat2

robbat2 commented Aug 21, 2023

Copy link
Copy Markdown
Author

maintainer:
It's not clear to me why the FreeBSD build cannot find the new symbol. The Linux build finds it correctly, even with as-needed.

./configure -C --enable-maintainer-mode CFLAGS="$CFLAGS -Wall -W -Wa,--noexecstack -Wl,--as-needed -O3 -ggdb3" && make clean && gmake -j && strace -e trace=setsockopt ./rsync --sockopts='SO_INCOMING_CPU=1,IP_FREEBIND,IPTOS_RELIABILITY,TCP_FASTOPEN,TCP_FASTOPEN_CONNECT'  localhost::

...
gcc -I./zlib  -Wall -W -Wa,--noexecstack -Wl,--as-needed -O3 -ggdb3 -DMAINTAINER_MODE -DHAVE_CONFIG_H -Wall -W  -o rsync flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o progress.o pipe.o sockopts.o  simd-checksum-x86_64.o  params.o loadparm.o clientserver.o access.o connection.o authenticate.o lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o  zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o  -lattr -lacl -lpopt -llz4 -lzstd -lxxhash -lcrypto 
setsockopt(3, SOL_SOCKET, SO_INCOMING_CPU, [1], 4) = 0
setsockopt(3, SOL_IP, IP_FREEBIND, [1], 4) = 0
setsockopt(3, SOL_IP, IP_TOS, [4], 4)   = 0
setsockopt(3, SOL_TCP, TCP_FASTOPEN, [1], 4) = 0
setsockopt(3, SOL_TCP, TCP_FASTOPEN_CONNECT, [1], 4) = 0
rsync-test-module	
+++ exited with 0 +++

Comment thread Makefile.in Outdated
@robbat2 robbat2 force-pushed the sockopts branch 2 times, most recently from 8a110d1 to 78357b0 Compare August 21, 2023 20:21
@robbat2

robbat2 commented Aug 21, 2023

Copy link
Copy Markdown
Author

@WayneD this is ready for your review

@tridge

tridge commented Apr 6, 2024

Copy link
Copy Markdown
Member

@robbat2 needs a rebase

@robbat2

robbat2 commented Apr 8, 2024

Copy link
Copy Markdown
Author

@tridge rebased now; only conflict was in NEWS.md ; verified that the tests also still pass

@robbat2

robbat2 commented Jul 8, 2024

Copy link
Copy Markdown
Author

@tridge rebased again if you could merge please?

Add support for many more socket options, including those that take
string inputs, such as `TCP_CONGESTION=bbr`.

Options known to the code, but not present at build time will now emit
an error that is distict from options unknown to the code (unknown vs
not-available).

This patch greatly eases running specific rsync configurations, without
relying on LD_PRELOAD to modify socket behaviors.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
@robbat2

robbat2 commented Nov 15, 2024

Copy link
Copy Markdown
Author

@WayneD @tridge merge please? rebased again for NEWS.md changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants