[Fixed] [5.2] WireGuard config import truncates a bracketed IPv6 Endpoint to "[<first-hextet>"

REPRODUCIBILITY: 100%
OS VERSION: 5.2.0.15
HARDWARE: Jolla Phone (jp2601, “Jolla Phone 2026”), SoC MediaTek MT6858, kernel 6.12.38-4k
UI LANGUAGE: English
REGRESSION: No — WireGuard is a 5.0+ feature; this has (as far as I can tell) never worked

DESCRIPTION:

Component: Settings → VPN → WireGuard config import / endpoint parsing.

Steps to reproduce: import a WireGuard .conf whose peer uses an IPv6-literal endpoint in the standard bracket notation:

[Peer]
Endpoint = [2001:db8::1]:51820

Actual result: the stored/displayed endpoint is truncated to [2001 — the parser stops at the first colon inside the brackets, discarding the rest of the address and the port. The tunnel then has no valid endpoint and cannot connect.

Verified: the .conf on disk is intact (cat shows the full [2001:db8::1]:51820) — only Sailfish’s import/parse layer mangles it. [<ipv6>]:<port> is the correct wg-quick / RFC-3986 notation and is accepted verbatim on desktop Linux.

Expected result: endpoint stored/shown as the full [<ipv6>]:<port>.

Workaround: use a hostname endpoint (no brackets, no inner colons) — imports intact. On IPv6-only mobile the hostname must resolve to an AAAA (see the related “uses the unroutable IPv4 endpoint” issue).

Additional information: part of a set of IPv6-only-mobile WireGuard issues found on the Jolla Phone 2026 (SFOS 5.2), filed separately — connmand SIGSEGV on WG connect (thread 30643); mobile data comes up IPv6-only (thread 11917); connman-vpn doesn’t install AllowedIPs routes; and the mobile-data usage counter reads 0 for IPv6-only traffic.

2 Likes

Yes, parsing the config doesn’t deal with IPv6 addresses:

From nemo-qml-plugin-connectivity/src/nemo-connectivity/settingsvpnmodel.cpp


        if (settings.contains(QStringLiteral("Endpoint"))) {
            QStringList endpoint = settings.value(QStringLiteral("Endpoint")).toString().split(u':');
            rv.insert(QStringLiteral("Host"), QString(endpoint[0]));
            if (endpoint.size() == 2)
                rv.insert(QStringLiteral("WireGuard.EndpointPort"), QString(endpoint[1]));
             else // No port, use default
                rv.insert(QStringLiteral("WireGuard.EndpointPort"), QStringLiteral("51820"));
        }

So it splits by colon and uses the first value.

1 Like

I made Wireguard config: handle host in IPv6 bracket notation by nephros · Pull Request #21 · sailfishos/nemo-qml-plugin-connectivity · GitHub, hope it improves things.

If you’re very very brave you might try the package from Index of /obs/home:/nephros:/sailfishos/sailfishos_latest_aarch64/aarch64 - I don’t have a wireguard config here to test…

4 Likes

Thanks for reporting, there is a PR to address this - if the Endpoint cannot be parsed it will be used as is with the default port which I guess is better than just omitting the invalid content.

2 Likes

Fixed by [Release notes] Finlayson 5.2.0.18 - Jolla Phone first