g4klx / MMDVMHost

The host program for the MMDVM
GNU General Public License v2.0
379 stars 274 forks source link

MMDVM.ini: [DMR Network] LocalAddress setting for Direct connection #745

Open jg1uaa opened 2 years ago

jg1uaa commented 2 years ago

Today I rewrite my MMDVM.ini and I found this problem.

I: 2022-03-20 12:18:24.336 Started the DMR Id lookup reload thread
I: 2022-03-20 12:18:34.332 Opening UDP port on 62032
E: 2022-03-20 12:18:34.335 Error returned from sendto, err: 22
E: 2022-03-20 12:18:34.336 DMR, Socket has failed when writing data to the master, retrying connection
M: 2022-03-20 12:18:34.337 Closing DMR Network
M: 2022-03-20 12:18:34.539 Opening DMR Network
I: 2022-03-20 12:18:44.333 Opening UDP port on 62032
E: 2022-03-20 12:18:44.334 Error returned from sendto, err: 22
E: 2022-03-20 12:18:44.335 DMR, Socket has failed when writing data to the master, retrying connection
M: 2022-03-20 12:18:44.336 Closing DMR Network
M: 2022-03-20 12:18:44.355 Opening DMR Network

write() for UDP socket returns EINVAL on Linux(Debian-11.2/amd64), this is occured "Type=Direct" and "LocalAddress=127.0.0.1" in [DMR Network] section. on OpenBSD, there is no error but not working.

Solution: set LocalAddress=0.0.0.0 or delete LocalAddress entry when Type=Direct. maybe this is not bug, but need to add comment to MMDVM.ini.

Reference: https://github.com/nodejs/node/issues/29047

iddq commented 2 years ago

LocalAddress cannot be 127.0.0.1 if the remote address is non-local. :)

jg1uaa commented 2 years ago

Experts know such a thing, but non-expert strays by misconfiguration. It will be a good help that adding "# LocalAddress should be commented out when Type=Direct" message to MMDVM.ini.