I am running a c++ program which tries the following code:
socket(PF_INET6, SOCK_DGRAM, 0)
However the above returns -1 once in a while (maybe 1 time in over 3000 runs) and errno shows:
Errno 97: Address family not supported by protocol
How is this possible? Running this line should yield the same result over and over again?
@Asaf good thinking, I was assuming there were a problem with my code rather than the machine it was running on.
So I started to investigate the machines (on the test environment) and it turned out one of the machines was not configured properly so it always failed on that machine.