New issue
Advanced search Search tips

Issue 812439 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 735637
Owner: ----
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

wpad.dat command sInNet(dnsResolve(host) doesnt work within chrome, on some devices, that are in use after a few months.

Reported by administ...@alamandacollege.vic.edu.au, Feb 15 2018

Issue description

Chrome Version       : 64.0.3282.167 . MAC OS 10.13.3 64bit
URLs (if applicable) :
Other browsers tested: Safari Firefox
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari: OK
    Firefox: OK

What steps will reproduce the problem?
(1) on first use of chrome all devices work fine with our wpad.dat file, but for some student devices over time, later on are unable to resolve the proxy, for no apparent reason, other than it appears that chrome isn't reading the if (isInNet(myIpAddress() command within wpad.dat file correctly.

The wpad.dat file is as follows:

------ start of wpad file ------

function FindProxyForURL(url, host) {

if (dnsDomainIs(host, "mdm.alamandacollege.vic.edu.au") ||
        shExpMatch(host, "(*.alamandacollege.vic.edu.au|alamandacollege.vic.edu.au)"))
        return "DIRECT";

if (isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
    isInNet(dnsResolve(host), "172.16.0.0",  "255.240.0.0") ||
    isInNet(dnsResolve(host), "17.0.0.0",  "255.0.0.0") ||
    isInNet(dnsResolve(host), "192.168.0.0", "255.255.0.0") ||
    isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "10.175.96.0", "255.255.240.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.90.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.91.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.92.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.93.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.94.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.95.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.96.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.97.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.98.0", "255.255.255.0"))
    return "DIRECT";
else
if (isInNet(myIpAddress(), "192.168.99.0", "255.255.255.0"))
    return "DIRECT";
else

if (isInNet(myIpAddress(), "192.168.100.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.110.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.120.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.130.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.140.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.150.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.160.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.170.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.180.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.190.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.200.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.210.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";

else
if (isInNet(myIpAddress(), "192.168.220.0", "255.255.254.0"))
    return "PROXY 10.175.96.50:8888; DIRECT";
else
if (isInNet(myIpAddress(), "192.168.230.0", "255.255.254.0"))
    return "DIRECT";

else
return "DIRECT";

}

---end of wpad file ----


What is the expected result?
the wpad file should be read correctly and assigned their proxy, based on the network IP the client is assigned.




What happens instead?
Chrome indicates within chrome://net-internals/#proxy
that the wpad.dat file is in effect, but cannot browse via the specified proxy based on the rule if (isInNet(myIpAddress(). Chrome is 

IF the following wpad.dat settings are used:
----start of wpad----
function FindProxyForURL(url, host)
{
      return "PROXY 10.175.96.50:8888";
}
----end of wpad----

within chrome://net-internals/#proxy 

the proxy will resolve

both wpad.dat scripts work well while using safari, but on the devices where this occurs, they are unable to respond to the if (isInNet(myIpAddress() command.

I have yet to find any additional underlying issues, but suspect that there might be files within chrome stored under /library pr ~/library corrupting, after an update of chrome, or after extensions are applied to the browser.


 
Labels: Needs-Triage-M64
Components: Internals>Network>Proxy
Status: Untriaged (was: Unconfirmed)
Are these recent reply comments just internal discussion or something else?
To make amendment to my post:

Safari always works with all wpad tests, where as chrome does not work, if the wpad file references the IF (isInNet(myIpAddress() wpad command, the error never appears on first use of chrome, and only seems to show up on devices, a few weeks in from their original installation.

What does Needs-triage-m64 and untriage refer to?

And is there anything I can assist with to further diagnose the problem?

Comment 4 by eroman@chromium.org, Feb 20 2018

I don't understand your problem description.

You list two different PAC scripts in the first comment, what is the relationship between them? (The second returns unconditionally PROXY 10.175.96.50:8888, whereas the first one returns "PROXY 10.175.96.50:8888; DIRECT" for some branches.)

Also what is mean by the capitalized "IF (isInNet(myIpAddress()"? The "if" token needs to be lowercase in Javascript,

Without understanding your issue, I would guess the problem has to do with the use of myIpAddress(), which can:
  (a) Return different things when there are multiple interfaces
  (b) Has historically had problems with returning 127.0.0.1 in some circumstances.
  (c) Does not return IPv6 addresses for compatibility reasons.

I would start by adding some alert() statements to the script to print out what myIpAddress() is returning.

And for issue (c) you can use myIpAddressEx() instead (although will need to check if the method is defined to accomodate browsers that don't define it)
thanks for your reply, really appreciate it.

sorry for the capital IF, the whole description was a bit of a novel to write.

but yes it appears the underlying issue is with the myIpAddress() not recognising the associated IP and as a result not assigning the appropriate proxy.

The "PROXY 10.175.96.50:8888; DIRECT" . was an attempt to allocate fail over, where if the browser attempts to call the wpad file while cached, while on a outside network with the same range, it would eventually still resolve.

Based on your response, I might add two changes as a test to see if it resolves the problem...

else
if (isInNet(myIpAddress(), "127.0.0.1", "255.255.255.0"))
    return "PROXY 10.175.96.50:8888;

and remove the DIRECT from the ones where its listed as 10.175.96.50:8888; DIRECT";

we dont use ipv6 internally, but this may also be a factor to our problems.

the multiple interfaces should be contributing to the matter, as the devices only use wifi while within the internal network.

The overall problem is only found with the chrome browser though, and not safari, which led me to the possibility that it was a chrome problem at hand.

I will keep you posted with my findings.

I will have to research the alert() command.

Once again really appreciate the reply.




Comment 6 by eroman@chromium.org, Feb 28 2018

Mergedinto: 735637
Status: Duplicate (was: Untriaged)
Thanks.

This is probably a dupe of  Issue 735637  -- myIpAddress() is broken on Chrome Mac and returns 127.0.0.1.

You can test this using "alert()" as a means to do logging. Add this to your PAC script:

alert("MYLOG: myIpAddress: " + myIpAddress());
if (myIpAddressEx)
  alert("MYLOG: myIpAddressEx: " + myIpAddressEx());

Then go to chrome://net-internals/#proxy and click the button to re-load it.

Then go to chrome://net-internals/#events and do a search for PAC_JAVASCRIPT_ALERT to see what alert() is logging.

I will tentatively dupe against 735637, but if that was incorrect feel free to respond on this thread.
Interesting, your respones have helped, I added the followign rules which appear to have resolved the issue:
else
if (isInNet(myIpAddress(), "127.0.0.1", "255.255.255.0"))
    return "PROXY 10.175.96.50:8888;
else
if (isInNet(myIpAddress(), "0.0.0.0", "0.0.0.0"))
    return "PROXY 10.175.96.50:8888;

(still in testing mind you - haven't complaints from home use from users yet).

However, I am curious if this is something that could be resolved on chrome's end, if results respond with a 127.0.0.1 perhaps chrome is detecting the wrong adapters IP, and that if there was a means to check for the adapter that has a Default gateway in use, that this might fix the underlying issue on your end for all your users, rather than on a case by case basis. Assuming that the adapter responding with 127.0.0.1 doesn't have a gateway.

Comment 8 by eroman@chromium.org, Mar 19 2018

Thanks for the feedback!

Yes, this is a Chrome-side bug which needs a Chrome side resolution (i.e.  issue 735637 )

Sign in to add a comment