Skip to content

daemon: report errors when the BGP listen sockets cannot be created - #627

Merged
fujita merged 1 commit into
osrg:masterfrom
fujita:report-listen-socket-error
Sep 24, 2026
Merged

fujita merged 1 commit into
osrg:masterfrom
fujita:report-listen-socket-error

Conversation

@fujita

@fujita fujita commented Sep 24, 2026

Copy link
Copy Markdown
Member

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.

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>
@fujita
fujita merged commit 123bfca into osrg:master Sep 24, 2026
15 checks passed
@fujita
fujita deleted the report-listen-socket-error branch September 24, 2026 13:33
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.

Daemon does not report any errors when it has no permissions to bind on 179

1 participant