makeQuerySocket in pdns/resolver.cc has a line:
ourLocal.sin4.sin_port = htons(10000+(dns_random(10000)));
This uses ports defined as user ports.
"Port numbers are assigned in various ways, based on three ranges: System Ports (0-1023), User Ports (1024-49151), and the Dynamic and/or Private Ports (49152-65535);
While writing an selinux policy for pdns I run into the issue that selinux only allows binding to the ephemeral port range, in the current case of linux that is port 32768-61000.
It would be great if powerdns can be changed, so it uses ports from this higher range.
use the right binding code for TCP vs UDP, thanks Sander Hoentjen. Cl…
…oses #644 and possibly #643
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3014 d19b8d6e-7fed-0310-83ef-9ca221ded41b
If #644 outcome means that tcp port will be automatically chosen:
ourLocal.sin4.sin_port = 0
then this bug does probably not need fixing wrt selinux
#644 was fixed in r3014, please let me know whether this fixes #643 for you too!
yes, r3014 seems to fix this issue as well, thanks!