mrefd and mvoice

A reflector for a mode like M17 is something like a chat server - it has rooms or channels, called “modules”, and whoever talks in one channel gets broadcast out to all other nodes in that same channel.

These channels can also be linked with channels on other reflectors, which allows for creating vast networks of audio conferences for linking ham radio clients together around the world.

I’ve never actually used a reflector like mrefd, but someone on IRC reported constant “connect” messages being printed to the screen attempting to link to M17-POL, but no packets being sent.

I guess it was finally time to learn.

The symptoms

Repeated lines printed like

Sent connect packet to M17 peer M17-POL @ for module D (module B)

Problem is, it wasn’t actually sending packets as observed with tcpdump.

The error as observed with strace

[pid  1645] sendto(-1, "CONN\v\371\235\201\372\355D", 11, 0, {sa_family=AF_INET, sin_port=htons(17000), sin_addr=inet_addr("")}, 16) = -1 EBADF (B
ad file descriptor)

The fix

Turns out, the config requires an IP being set for at least either IPv4 or IPv6 so it can bind the socket. Otherwise, the networking socket can’t send, leading to the symptoms seen.