Closed Bug 238341 Opened 22 years ago Closed 21 years ago

PAC: myIpAddress() returns ::1 instead of IPv4 (127.0.0.1)

Categories

(Core :: Networking, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 140309

People

(Reporter: jonny, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 Trying to write a proxy.pac file for some bunch of clients, I found this on a Windows XP client, with IPv6 installed, although not configured. This means that the client has IPv6 stack, link local addresses and loopback (::1) addresses only. When running PAC, myIpAddress() returns "::1", and not the real IPv4 address, as I would have expected. Maybe my fault, for not having a real IPv6, but this may be common in the near future. The big problem: PAC scripts do not behave well, and no error reporting is given to the user. Only after knowing what the problem really was, it was somewhat easy to workaround it. Reproducible: Always Steps to Reproduce: 1. Install Windows XP SP1 with IPv6 support 2. Do NOT add a fixed IPv6 address or an auto-tunneling router. Even better, let this be the only machine with IPv6 on the network. 3. Load a PAC file 4. Enable jsconsole and set an alert( myIpAddress() ) Expected Results: Since we have IPv6, but no usable address, and we have IPv4 with usable addresses, I would expect to see the IPv4 address return. I'm not sure what should be the behaviour if only ::1 and 127.0.0.1 are available, though. Maybe, for backwards compatibility, 127.0.0.1. Also, some kind of error reporting for PAC would be useful a lot.
Should have been fixed in 1.4b, per bug 191715. I don't know if we have many XP IPv6 users, maybe it slipped through somehow?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: PAC: myIpAddress() returns ::1 instead of a real IP → PAC: myIpAddress() returns ::1 instead of IPv4 (127.0.0.1)
(In reply to comment #2) > Should have been fixed in 1.4b, per bug 191715. I don't know if we have many XP > IPv6 users, maybe it slipped through somehow? I may be wrong, but it seems that bug 191715 is related to DNS, and this one is related to detecting the host's local address, and being so, are not related. If mozilla is not yet IPv6 compliant, the local address should always be Pv4. If it is IPv6 compliant, isInNet should be upgraded to deal with them. Maybe new functions like isIPv4(), isIPv6() and isInNet6() would be useful.
I think we are using DNS to find the IP address... This is actually a dupe of bug 140309, which depended on the other bug where the fix occured. *** This bug has been marked as a duplicate of 140309 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Component: Browser-General → Networking
QA Contact: general → benc
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.