summaryrefslogtreecommitdiff
path: root/src/binddynport.c
Commit message (Collapse)AuthorAgeFilesLines
* Add an internal helper for binding to a dynamically-assigned portChuck Lever2018-03-011-0/+139
Create a helper function akin to bindresvport(3) that instead binds to a dynamically assigned port using the rules in RFC 6335 Section 6 to avoid all IANA-assigned service port numbers. This is intended to remain an internal helper for the time being, so this commit provides no header declaration. All internal bindresvport(3) call sites manufacture an INADDR_ANY- type address to pass to bind(2), so the helper handles that as well, to avoid code duplication. This means that callers do not need to pass in a sockaddr. Only an open socket is required. BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=320 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>