SO_REUSEPORT optval should be tested for non-zero.

This should be a portable solution. On Linux getsockopt
returns 1 even if it is set to non-zero value other than 1.