Skip to content

Reconnect retry IPv4 on IPv6 failure #1146

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

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

slingamn
Copy link
Contributor

Track the address family of the last failed connection attempt (either immediately or during TLS handshake), then disprefer that address family during reconnection.

A note on testing ipv6 connectivity failure on Linux: disable_ipv6 will not simulate it correctly, because irssi calls getaddrinfo(3) with AI_ADDRCONFIG, which suppresses resolution of ipv6 addresses if no local ipv6 address is available.

The correct way to simulate this is with disable_ra. That way, the link-local address will remain, and getaddrinfo(3) will return addresses corresponding to AAAA records, but attempts to connect to them will fail with "Network is unreachable".

I tested a few different cases (disable_ra for cutting off ipv6, an iptables rule dropping outgoing packets for cutting off ipv4), but this probably needs more testing --- let me know if you have suggestions.

Track the address family of the last failed connection attempt
(either immediately or during TLS handshake), then disprefer
that address family during reconnection.
@slingamn
Copy link
Contributor Author

This is really a band-aid because it imposes the standard reconnection timeout (default 5 minutes?) on any attempt to fail over from ipv6 to ipv4 or vice versa. Ideally in the future we'd do one of the following:

  1. A suggestion from nei in #irssi: resolve all the addresses, then do local round-robin over them (sorting them in the order implied by resolve_prefer_ipv6) until a connection succeeds.
  2. A full Happy Eyeballs implementation

@ailin-nemui
Copy link
Contributor

@irssi/developers

@ailin-nemui
Copy link
Contributor

nb this will require an abi bump due to added field

@ailin-nemui ailin-nemui changed the title fix #641 Reconnect retry IPv4 on IPv6 failure Dec 10, 2019
@ailin-nemui
Copy link
Contributor

@irssi/developers

@ailin-nemui ailin-nemui added the auto-merge This PR is scheduled for merge if no further comments are opened label Dec 28, 2019
@ailin-nemui ailin-nemui merged commit 6e14ace into irssi:master Jan 6, 2020
@ailin-nemui ailin-nemui added this to the 1.3.0 milestone Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge This PR is scheduled for merge if no further comments are opened
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants