Strange result (EPERM) from a call to connect(2)

Ronald F. Guilmette rfg at monkeys.com
Thu Oct 28 12:51:11 PDT 2004


I am testing a program that I am developing that makes quite a lot of
simultaneous outbound TCP connections.

While performing the testing, one of the calls to connect(2) within the
program returned a -1 (error) result, and when the errno value was then
checked, it had a value of EPERM.

This is very unexpected and highly disconcerting.  In the man page for
connect(2) on the system I am using (4.10-RELEASE) there is no mention
of the possibility of EPERM being a type of result that one might expect
from a failed call to connect(2).

So anyway, my questions:

What conditions may cause connect(2) to yield EPERM on 4.10-RELEASE?

What, if anything, can be done to mitigate or eliminate such error
conditions?  If there some sysctl variable or some kernel build-time
variable that I could adjust that might possible eliminate this error,
or at least cause it to be less common in practice?



More information about the freebsd-net mailing list