Refactor the function to read the IPv6 sysctl parameter. Bug: 291182564 Test: atest NetworkStackRootTests Change-Id: I9c9a8bbf462acfb7cf1d65740ba7fbe5e2e128c4