tests: fix SO_REUSEPORT tests for old Linux and non-Linux
commita1aa5c97289df09a90831c4d9bf6e22ac351bdd8
authorEric Wong <normalperson@yhbt.net>
Mon, 4 Nov 2013 18:28:46 +0000 (4 18:28 +0000)
committerEric Wong <normalperson@yhbt.net>
Mon, 4 Nov 2013 18:28:46 +0000 (4 18:28 +0000)
tree1b5904f2effe8ae93d53662b5328758ce146a4c9
parent9c8747d290dfc7ab4bc11c4f88b3c284cc5ba949
tests: fix SO_REUSEPORT tests for old Linux and non-Linux

On BSD-derived platforms the getsockopt true value may be any
(>= 0) value, not just one as it is on Linux.

Additionally, SO_REUSEPORT is only supported since Linux 3.9, so
folks on older kernels may not have it available.  We still define it
for Linux since kernel upgrades are usually more common than glibc
upgrades.

Note: we will still raise an exception at runtime if a user
explicitly requests :reuseport in their config and runs an
older Linux kernel.

Reported-by: Andrew Hobson <ahobson@gmail.com>
test/unit/test_socket_helper.rb