Reduce a variable scope
Fix performance issue with HostIPv6 initialization