Fix UDP GRO/GSO tests.

1. The GRO test was failing on new kernels. This is because
   getsockopt(IPPROTO_UDP, UDP_GRO) is not supported: the option
   can only be set, not get. Don't attempt to get it.
2. The GSO test was failing on older kernels because it fetched
   the kernel version as a double and then compared it against
   4.19. This fails on 4.9 and 4.4 kernels because 4.19 < 4.4.
   Fix this by fetching the kernel version as a 2-int array
   instead of a single double.

Bug: 172945027
Fix: 178257424
Test: atest libcore.android.system.OsTest#test_socket_udpGro_set passes on redfin and crosshatch
Change-Id: I862a8fe88521c0ac6e94c0c281ebb2daedc8e19a
1 file changed