Fix ipconfig command to show IPv6

This commit also contains fixes for proper extraction of subnet masks
based on operating system.