Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004191Doomseeker[All Projects] Bugpublic2024-01-31 16:592024-10-09 19:47
ReporterNecrodoom 
Assigned ToZalewa 
PrioritynormalSeverityminorReproducibilityalways
Statusneeds testingResolutionopen 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version1.4.1 
Target Version1.5.0Fixed in Version 
Summary0004191: Doomseeker lists incorrect IP address when attempting to connect to a LAN server
DescriptionWhen doomseeker detects a LAN server, it sees it correctly, but when generating the commandline for it, it appends ::ffff: to the ipaddress, causing zandronum to parse it as a localhost server. For example, a server hosted on 192.168.0.107:10666 will make doomseeker generate the address of ::ffff:192.168.0.107:10666. This prevents joining LAN servers on doomseeker without pinning the server or via direct commandline.
Attached Files

- Relationships

-  Notes
User avatar (0024054)
Zalewa (developer)
2024-10-07 18:00

OK, so this happens because we bind the UDP socket that is listening to the LAN broadcasts to an "Any" address. This "Any" is both IPv4 and IPv6. Here.

When a broadcast packet arrives, we need to know where it came from. We obtain the address of the host who sent it here.

Now, it appears that if the system Doomseeker runs in has an IPv6 address (regardless if there's actual connectivity) and the socket is bound to this encompassing "Any", Qt will map IPv4 addresses to IPv6. Converting such address to a string, for command line purposes, will produce the IPv6 address string as stated in the report.

To fix this, I can try mapping such IPv6 address back to an explicit IPv4 address.

I actually tried that, the code is rather short:

// Qt may provide us with an IPv4-mapped IPv6 address, so
// convert it to an explicit IPv4 if it's a mapped IPv4.
if (sender.protocol() == QAbstractSocket::IPv6Protocol)
{
    bool isMapped = false;
    quint32 ipv4 = sender.toIPv4Address(&isMapped);
    if (isMapped)
    {
        sender = QHostAddress(ipv4);
    }
}

If fixes the issue: you can connect to the server. The question is: will this blow anything up in an environment with real IPv6? I suspect no, because the LAN broadcasts, as Zandronum uses them, don't even function in IPv6. So, this feature is a pure IPv4 thing anyway.

Just in any case, I haven't pushed this fix yet, but it seems a valid one. I asked the tin can about it and it also says it should be ok, but the tin can can never be fully trusted.

An alternative fix would be not to bind the socket to "Any", but to "AnyIPv4". Qt should then cease to produce IPv4-mapped IPv6 addresses, but this may cause some error messages in environments where there is no IPv4 at all, and handling this properly may be more complicated than just remapping the IP.
User avatar (0024057)
Zalewa (developer)
2024-10-09 19:47

Fix applied, let's hope it's gonna be ok:
'https://bitbucket.org/Doomseeker/doomseeker/commits/0e8c84ab773ba175414f63b698bb865209e98702 [^]'

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2024-01-31 16:59 Necrodoom New Issue
2024-07-27 15:10 Zalewa Assigned To => Zalewa
2024-07-27 15:10 Zalewa Status new => acknowledged
2024-07-27 15:10 Zalewa Target Version => 1.5.0
2024-10-07 16:05 Zalewa Status acknowledged => assigned
2024-10-07 18:00 Zalewa Note Added: 0024054
2024-10-07 18:00 Zalewa Status assigned => feedback
2024-10-09 19:47 Zalewa Note Added: 0024057
2024-10-09 19:47 Zalewa Status feedback => needs testing






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker