Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robbat2
Copy link

@robbat2 robbat2 commented Aug 20, 2023

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
Copy link
Author

robbat2 commented Aug 21, 2023

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 +++

Makefile.in Outdated Show resolved Hide resolved
@robbat2 robbat2 force-pushed the sockopts branch 2 times, most recently from 8a110d1 to 78357b0 Compare August 21, 2023 20:21
@robbat2
Copy link
Author

robbat2 commented Aug 21, 2023

@WayneD this is ready for your review

@tridge
Copy link
Member

tridge commented Apr 6, 2024

@robbat2 needs a rebase

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
Copy link
Author

robbat2 commented Apr 8, 2024

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

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.

None yet

3 participants