Added ip6/ip4 switch for Android compatibility