Welcome, Guest
Submit ComicRack bugs to get them squashed

TOPIC: Partial bugfix for WiFi Pairing

Partial bugfix for WiFi Pairing 1 year 5 months ago #45560

  • predakanga
  • predakanga's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 2
  • Karma: 1
Just a warning for any users looking for good news, this post will only be useful for cYo, though I include instructions to see whether it affects you too.

I've discovered a bug with WiFi pairing that affects users with more than one network interface:

When registering to the multicast group, WirelessSyncProvider.StartListen specifies IPAddress.Any for the local endpoint. Unlike what you might expect, this does not tell Windows to register on all interfaces, but to pick just one by it's routing rules. This is often the wrong one - for instance, it will often pick virtualization software's interfaces instead of your real network interface.

There are multiple possible solutions listed here - I haven't tested them all, but the logic is sound - floppes provides a robust solution.

To verify this bug, you can use the command "netsh interface ip show joins" to view which interfaces are joined to multicast groups. In my case, you can see the results before and after fixing this bug in these screenshots. Note that "Interface 13: Ethernet" is my normal network adapter, and "" is the multicast address used by ComicRack. Before the fix, it's only present on DocketNAT, which is a network adapter used by some of my development VMs.

The fix that I applied to get the above behaviour was relatively simple - I started a debugging session for ComicRack in Visual Studio, with a breakpoint on WirelessSyncProvider.StartListen (I used dotPeek to generate the symbols), and after the usual AddMembership call, I ran the following in the Immediate window:
client.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, (object)new MulticastOption(group, 13))
// With 13 being the index of my regular network adapter, as shown above

After running this command and going to pair device, ComicRack was able to detect my Android tablet with no problems; it's syncing now.

Hope that helps,
The administrator has disabled public write access.
Time to create page: 0.334 seconds

Who's Online

We have 216 guests and 2 members online