Skip to content

fix: Fix detecting IP version from host names#3266

Open
tvogel wants to merge 2 commits intoLogflare:mainfrom
tvogel:fix-ipv6
Open

fix: Fix detecting IP version from host names#3266
tvogel wants to merge 2 commits intoLogflare:mainfrom
tvogel:fix-ipv6

Conversation

@tvogel
Copy link
Copy Markdown
Contributor

@tvogel tvogel commented Mar 10, 2026

Because Utils.ip_version does not resolve host names but only checks IP-address strings, instead use the existing detect_ip_version function (again) that in fact resolves host names.
(After all, it makes sense to resolve names when you check DB_HOSTNAME or the host part of a URL.)

@tvogel tvogel changed the title runtime.exs: Fix detecting IP version from host names runtime.exs: Fix detecting IP version from host names (fixes #3073) Mar 10, 2026
@tvogel tvogel changed the title runtime.exs: Fix detecting IP version from host names (fixes #3073) fix: Fix detecting IP version from host names Mar 10, 2026
@tvogel
Copy link
Copy Markdown
Contributor Author

tvogel commented Mar 10, 2026

Fixes #3073

@tvogel tvogel force-pushed the fix-ipv6 branch 2 times, most recently from 61fada4 to de7fa67 Compare March 10, 2026 11:42
@Ziinc
Copy link
Copy Markdown
Contributor

Ziinc commented Mar 16, 2026

@tvogel thanks for the contribution. We should shift the logic to Utils instead, not ideal to have two implementations that aim to do the same thing but behave differently. We can get rid of the anonymous func.

tvogel added a commit to tvogel/logflare that referenced this pull request Mar 19, 2026
see
Logflare#3266 (comment)

runtime.exs:
use Utils.ip_version() again;
drop detect_ip_version.();

utils.ex:
adjust ip_version() to support host names;
distinguish unresolvable from empty input (nil or empty string);
tvogel added a commit to tvogel/logflare that referenced this pull request Mar 19, 2026
see
Logflare#3266 (comment)

runtime.exs:
use Utils.ip_version() again;
drop detect_ip_version.();

utils.ex:
adjust ip_version() to support host names;
distinguish unresolvable from empty input (nil or empty string);
tvogel added a commit to tvogel/logflare that referenced this pull request Mar 19, 2026
see
Logflare#3266 (comment)

runtime.exs:
use Utils.ip_version() again;
drop detect_ip_version.();

utils.ex:
adjust ip_version() to support host names;
distinguish unresolvable from empty input (nil or empty string);
tvogel added 2 commits March 19, 2026 17:35
see
Logflare#3266 (comment)

runtime.exs:
use Utils.ip_version() again;
drop detect_ip_version.();

utils.ex:
adjust ip_version() to support host names;
distinguish unresolvable from empty input (nil or empty string);
@tvogel
Copy link
Copy Markdown
Contributor Author

tvogel commented Mar 19, 2026

@tvogel thanks for the contribution. We should shift the logic to Utils instead, not ideal to have two implementations that aim to do the same thing but behave differently. We can get rid of the anonymous func.

Hi @Ziinc, I moved the check to Utils. Please take a look!

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.

2 participants