PAC: myIpAddress() returns ::1 if IPv6 is enabled

RESOLVED DUPLICATE of bug 347307

Status

()

Core
Networking
RESOLVED DUPLICATE of bug 347307
7 years ago
5 years ago

People

(Reporter: Marcin Okraszewski, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0b10) Gecko/20100101 Firefox/4.0b10
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b10) Gecko/20100101 Firefox/4.0b10

If you have IPv6 stack enabled, the myIpAddress() is returning ::1, which is IPv6 loopback address (equivalent of 127.0.0.1). This bug made me disable IPv6, since I can still live without it. 

Checked on Windows XP and Win7, Firefox 4.0 and 3.6.

Reproducible: Always

Steps to Reproduce:
1. Add IPv6 protocol to an network adapter
2. Write proxy configuration script with alert(myIpAddress())
3. Check error console for the result
Actual Results:  
::1 - IPv6 loopback

Expected Results:  
IPv4 or IPv6 address that is used for communication with other systems, not loopback.



Actually there should be a list of IPs or at least option to choose if IPv4 or IPv6 to be used. See bug 558253.

Comment 1

7 years ago
see also bug 559664
and bug 336589 could be related as well

Comment 3

7 years ago
I cannot test it, but a workaround may be to remove any extra lines starting with "::1" from your hosts file, i.e. on Linux: /etc/hosts or on Windows e.g.
C:\Windows\System32\drivers\etc\hosts
See also http://ubuntuforums.org/showthread.php?t=826495

Comment 4

6 years ago
Tested and confirmed on Firefox 10.0 beta running under Windows 7 Pro SP1 32-bit. 
("Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0")

IPv6 disabled on the NIC, and using alert("IP Address " + myIpAddress());  
returns "PAC-alert: IP Address ::1"

IE 8 works with the same PAC.

Note also that the "set network.dns.disableIPv6 to true" workaround is successful, but undesirable.

see also <a href="show_bug.cgi?id=559664" title="Pac file function myIpAddress() returns Link local IPv6 address instead of correct IPv6 address">bug 559664</a>

and for proposed myIpAddressEx and dnsResolveEx enhancements, see <a href="show_bug.cgi?id=558253" title="Proxy Auto Config (PAC) Extended functions for multi-resolution and ipv6">bug 558253</a>

Comment 5

6 years ago
(In reply to Scott Stowers from comment #4)

(sorry about mucking up the embedded html code.)

Also forgot to mention, David von Oheimb's suggestion from the ubuntuforums.org thread did not apply in this case, as the etc/hosts file is empty.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 347307
You need to log in before you can comment on or make changes to this bug.