Repository navigation
daemon: report errors when the BGP listen sockets cannot be created - #627
Merged
Merged
Conversation
When rustybgpd cannot bind the BGP port, for example port 179 without root, it drops the error and keeps running without listening. The user sees no error, and no peer can connect. StartBgp also closes its sockets right after it creates them, so the listener loop creates them again with the wildcard addresses and ignores listen_addresses from the request. Create the listen sockets once and fail if one of them cannot be created. With a config file the daemon logs the error and exits, like FRR does when it has no usable listen socket. StartBgp returns FailedPrecondition and leaves BGP not started, like GoBGP, so a daemon started through the API does not crash. EAFNOSUPPORT on the default "::" address is ignored so that a host without IPv6 still starts. Closes: osrg#625 Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When rustybgpd cannot bind the BGP port, for example port 179 without root, it drops the error and keeps running without listening. The user sees no error, and no peer can connect. StartBgp also closes its sockets right after it creates them, so the listener loop creates them again with the wildcard addresses and ignores listen_addresses from the request.
Create the listen sockets once and fail if one of them cannot be created. With a config file the daemon logs the error and exits, like FRR does when it has no usable listen socket. StartBgp returns FailedPrecondition and leaves BGP not started, like GoBGP, so a daemon started through the API does not crash. EAFNOSUPPORT on the default "::" address is ignored so that a host without IPv6 still starts.
Closes: #625
Assisted-by: Claude Opus 5.5 noreply@anthropic.com
Did you use an AI tool?
If you did, say so here. See Using AI tools.