Skip to content

[FEATURE] IPv6 support in LocalDatabase fallback #51

@ErHaWeb

Description

@ErHaWeb

Summary

The current LocalDatabase fallback appears to support IPv4 only and does not properly handle IPv6 addresses.

LocalDatabase is still part of the default fallback chain, so this can lead to inconsistent behavior in dual-stack environments: IPv4 visitors may be resolved by the offline fallback, while IPv6 visitors are not.

Current behavior

In Classes/Domain/Service/IpToCountry/LocalDatabase.php, the lookup query is built with SQL conditions based on INET_ATON(...) against ipRangeStart / ipRangeEnd.

Because INET_ATON() is IPv4-oriented, the current offline fallback appears to be effectively IPv4-only.

In addition, the current table structure for tx_ipandlanguageredirect_domain_model_iptocountry does not show any explicit IP family handling, so a robust dual-stack lookup strategy does not seem to be in place yet.

Expected behavior

The offline fallback should support both IPv4 and IPv6 addresses.

Why this matters

On dual-stack websites, fallback behavior can otherwise differ depending on whether the visitor reaches the site via A or AAAA resolution.

That means geolocation-based redirects may work for IPv4 traffic but fail for IPv6 traffic, even though both requests hit the same TYPO3 setup.

Notes

This is likely not just a SQL function swap. To make this reliable, the implementation probably also needs:

  • a clear data model for IPv4 + IPv6 ranges
  • an IPv6-capable offline data source / import process
  • test coverage for dual-stack lookups

If maintaining IPv6 support in the offline table is currently out of scope, it would still be helpful to document clearly that LocalDatabase is IPv4-only at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions