n7tae / smart-group-server

A smart routing server (STARnet Group) especially for QuadNet
GNU General Public License v2.0
4 stars 4 forks source link

Choose random source port for reflector connection #10

Closed K2IE closed 5 years ago

K2IE commented 5 years ago

sgs currently uses ports 30001 and 30051 as sourced ports to connect to DExtra and DCS reflectors respectively. This prevents running sgs on the same host as a reflector.

Jun 05 15:59:53 myhost.net sgs[30373]: Cannot bind the UDP address (port: 30001), err: Address already in use

There is no need for sgs to use these ports as source ports and many good reasons to pick a random unused source port. I tested a randomized source port routine and discussed with Colby prior to the IPv6 push, but having reinstalled sgs on a new host running a reflector this issue has re-emerged. As a temporary fix I am binding the source port to 31001, but will now look at reintegrating the random source port routine into the current code.

n7tae commented 5 years ago

Available in the unstable branch now. This will be merged with master soon.