Fix crash determining local IPv6 address

Avoid a crash when determining the local IPv6 address due to a shadowed
variable.