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

If only one of IPv4 / IPv6 is configured, try the other protocol silently #2773

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cardano-node/src/Cardano/Node/Configuration/Socket.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ gatherConfiguredSockets NodeConfiguration { ncNodeIPv4Addr,

pure (ipv4', ipv6')

-- When IPv4 host is specified, try IPv6, but do not fail if missing.
-- Very relevant if operator is using RFC4941 on their block producing-node.
Comment on lines +172 to +173
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make sure lines fit into 80 columns.

(_, Nothing) -> do
info <- nodeAddressInfo Nothing ncNodePortNumber
let ipv6' = SocketInfo <$> find ((== AF_INET6) . addrFamily) info

pure (ipv4, ipv6')

-- When IPv6 host is specified, try IPv4, but do not fail if missing.
(Nothing, _) -> do
info <- nodeAddressInfo Nothing ncNodePortNumber
let ipv4' = SocketInfo <$> find ((== AF_INET) . addrFamily) info

pure (ipv4', ipv6)

_ -> pure (ipv4, ipv6)


Expand Down