Skip to content

[Bug] ldn_mitm UDP discovery on linux #272

@superjcvd

Description

@superjcvd

Prerequisites

  • I am confident that my issue has not been reported already in open OR closed issues.
  • I am able to reliably reproduce the issue on the latest stable or canary version.
  • I am not using an unofficial build (Flatpak, Emudeck, etc.).
  • I am a silly goose and didn't read these boxes.
  • I am a silly goose and DID read these boxes.

Description of the issue

On Linux when using ldn_mitm to play on local network between Ryubing instances (or modded switches) the network discovery feature is broken. The lobbies stay forever empty.

There is a comment about this issue in the source code but the fix is not correctly implemented.

/ryujinx/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnMitm/LanDiscovery.cs Line 320

We need to listen on the INADDR_BROADCAST address instead of the local address.
We need to replace LocalBroadcastAddr keyword with IPAddress.Broadcast

I have no C# knowledge and don't know how to complie the project to validate but the fix looks pretty logic to me.

            {
                if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
                {
                    _udp2 = new LdnProxyUdpServer(_protocol, LocalBroadcastAddr, DefaultPort);
                }
                _udp = new LdnProxyUdpServer(_protocol, LocalAddr, DefaultPort);
            }

It should be:

            try
            {
                if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
                {
                    _udp2 = new LdnProxyUdpServer(_protocol, IPAddress.Broadcast, DefaultPort);
                }

                _udp = new LdnProxyUdpServer(_protocol, LocalAddr, DefaultPort);
            }

Reproduction steps

  • Install latest Ryubing version on Linux.
  • Run it with ldn_mitm
  • Create a lobby on a compatible game and try to join/refresh the lobby list from another computer

Log file

...

OS

Linux

Ryujinx version

1.3.3

Game version

No response

CPU

No response

GPU

No response

RAM

No response

List of applied mods

No response

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.netcodeRelated to LDN or online functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions