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

mptcpize: set GODEBUG=multipathtcp=1 env var #316

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matttbe
Copy link
Member

@matttbe matttbe commented Nov 21, 2024

GO apps don't use the libC, so the LD_PRELOAD technique doesn't work with these apps.

But since GO 1.21, MPTCP is natively supported, and can be forced by simply setting GODEBUG=multipathtcp=1. So mptcpize can easily support GO apps by also setting this env var.

Similar to the LD_PRELOAD env var, the GODEBUG one is appended with a comma if it was already set.

Link: https://go.dev/doc/godebug
Link: https://pkg.go.dev/net#Dialer.SetMultipathTCP

Depends-on: #315

If any.

Before, previously set LD_PRELOAD were overridden. According to
'man ld.so', there can be more than one library to load before other
objects as this env var accepts a list separated by spaces or colons:

  A list of additional, user-specified, ELF shared objects to be loaded
  before all others.  This feature can be used to selectively override
  functions in other shared objects.

  The items of the list can be separated by spaces or colons, and there
  is no support for escaping either separator.

So let's do that: if a previous LD_PRELOAD is detected, it will no
longer be dropped, but used with the MPTCP Wrap library added at the
end, e.g.

  LD_PRELOAD=dummy.so:libmptcpwrap.so.0.0.1

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
GO apps don't use the libC, so the LD_PRELOAD technique doesn't work
with these apps.

But since GO 1.21, MPTCP is natively supported, and can be forced by
simply setting GODEBUG=multipathtcp=1. So mptcpize can easily support GO
apps by also setting this env var.

Similar to the LD_PRELOAD env var, the GODEBUG one is appended with a
comma if it was already set.

Link: https://go.dev/doc/godebug
Link: https://pkg.go.dev/net#Dialer.SetMultipathTCP
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11960004199

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 64.075%

Totals Coverage Status
Change from base Build 11930597849: 0.0%
Covered Lines: 1409
Relevant Lines: 2199

💛 - Coveralls

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.

2 participants