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

Enable SO_REUSEPORT #464

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

Conversation

netixx
Copy link
Contributor

@netixx netixx commented Apr 15, 2024

Enable SO_REUSEPORT on the TCP socket,

This enables multiple instances of the BGP server to be started on the same machine, binding to the same TCP port.

The kernel will load-balance the incoming connections to all listening instances.
Instances that have the correct BGP peers configured will take the connection,
and those who don't will reject it, letting another instance have a try when the router restarts the connection.

Signed-off-by: netixx <francois.espinet@ovhcloud.com>
@taktv6
Copy link
Member

taktv6 commented Apr 18, 2024

Thanks for contributing. LGTM in general. But I think we should make this configurable to avoid confusion for those who accidentally start multiple instances they didn't intent to.

@netixx
Copy link
Contributor Author

netixx commented Apr 18, 2024

ok, I added an option on the BGP server itself.

Maybe it would be better to push a list of options in the ListenAddrsPerVRF, so that we could set that per listener, but that is breaking change in terms of API.

(
Instead of map[string][]string we would need a

map[string]struct{
listenAddr []string
reusePort bool
}

)

Let me know if you would prefer that option :)

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

2 participants