"myIpAddress" function returns incorrect result in Internet Explorer 9

Symptoms

Consider the following scenarios.

Scenario 1
  • You configure Windows Internet Explorer 9 to use a proxy auto-config (PAC) file.
  • The computer is connected to the Internet.
  • You install an application on the computer that adds a virtual adapter. For example, you install VMware Player.
  • The PAC file calls the myIpAddress function to retrieve the IP address of the network adapter that is used to access the Internet.
In this scenario, the myIpAddress function returns the IP address of the virtual adapter.

For example, you write the following function in the PAC file. In this situation, the myIpAddress function returns the IP address of the virtual adapter.
function FindProxyForURL(url, host)
{
if (shExpMatch(myIpAddress(), "10.0.0.*")
{
//Bypass the proxy for URLs with-in the local domain
if (shExpMatch(host, "*.local.domain.com")) { return "DIRECT"; }

//Bypass the proxy when accessing local sites
if (isPlainHostName(host)) { return "DIRECT"; }

// Everything else goes through Proxy
return "PROXY 10.0.0.254:8080";
}

//Assume the computer is not at work.
return "DIRECT";
}

Scenario 2
  • You configure Internet Explorer 9 to use a PAC file.
  • The computer is connected to the Internet.
  • You establish an additional connection to your corporate network through a virtual private network (VPN).
  • The PAC file calls the myIpAddress function to retrieve the IP address from the VPN connection.
In this scenario, the myIpAddress function returns the IP address of the Internet connection.

Workaround

To work around this issue, write your own custom myIpAddress function for Internet Explorer 9. For example, you can write the following function:
function myIE9IpAddress() 
{
var ipex = myIpAddressEx();
if (ipex === false)
{
var myip=myIpAddress();
return myip;
}
var iparray = ipex.split(";");
for (j=0; j < iparray.length;j++)
{
var ipaddress=iparray[j];
//IPv6 adress : skip
var parts=ipaddress.split("::");
var firstpart=parts[0];
if (firstpart==="[fe80")
{
//alert("skipping IPv6 address :"+ ipaddress);
continue;
}

//IPv4 address starting with 192.: skip
parts=ipaddress.split(".");
firstpart=parts[0];
if (firstpart === "192")
{
//alert("skipping IPv4 address starting with 192. :"+ ipaddress);
continue;
}
break;
}
return ipaddress;
}

Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix Download Available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix Download Available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must have Internet Explorer 9 installed.

Registry information

Important
Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

After you apply this hotfix, you must make the following changes to the registry:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Expand the following subkey:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl
  3. Right-click FeatureControl, click New, and then click Key.
  4. Type FEATURE_SMART_MYIPADDRESS_BEHAVIOR_KB2839111, and then press Enter to name the new subkey.
  5. Right-click FEATURE_SMART_MYIPADDRESS_BEHAVIOR_KB2839111, click New, and then click DWORD Value.
  6. Type iexplore.exe, and then press Enter to name the new entry.
  7. Right-click iexplore.exe, and then click Modify.
  8. In the Value data box, type 00000001, and then click OK.
  9. Close Registry Editor.
For x64-based computers, you must also modify another registry key:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Expand the following subkey:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl
  3. Right-click FeatureControl, click New, and then click Key.
  4. Type FEATURE_SMART_MYIPADDRESS_BEHAVIOR_KB2839111, and then press Enter to name the new subkey.
  5. Right-click FEATURE_SMART_MYIPADDRESS_BEHAVIOR_KB2839111, click New, and then click DWORD Value.
  6. Type iexplore.exe, and then press Enter to name the new entry.
  7. Right-click iexplore.exe, and then click Modify.
  8. In the Value data box, type 00000001, and then click OK.
  9. Close Registry Editor.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.
File information

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Additional file information

Additional file information for Internet Explorer 9

Additional files for Internet Explorer 9 on all supported x86-based versions of Windows 7
File propertyValue
File nameX86_7a1c75d898de8a176757fabb1692c586_31bf3856ad364e35_9.1.8112.20618_none_2c2be6478c5a5965.manifest
File versionNot applicable
File size707
Date (UTC)19-Aug-2013
Time (UTC)19:58
PlatformNot applicable
File nameX86_a2d7b373a5d3c1db5063bc9c84cb2cf3_31bf3856ad364e35_9.1.8112.20618_none_7c5abefeca98592e.manifest
File versionNot applicable
File size726
Date (UTC)19-Aug-2013
Time (UTC)19:58
PlatformNot applicable
File nameX86_microsoft-windows-i..tocolimplementation_31bf3856ad364e35_9.1.8112.20618_none_c2779f10f8c68a59.manifest
File versionNot applicable
File size41,086
Date (UTC)18-Aug-2013
Time (UTC)10:59
PlatformNot applicable
File nameX86_microsoft-windows-ie-runtimeutilities_31bf3856ad364e35_9.1.8112.20618_none_083255ece377a8b6.manifest
File versionNot applicable
File size4,525
Date (UTC)18-Aug-2013
Time (UTC)10:59
PlatformNot applicable
Additional files for Internet Explorer 9 on all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
File propertyValue
File nameAmd64_18dd7229afddebbbf2a1579deadd781a_31bf3856ad364e35_9.1.8112.20618_none_e96499b567291b0d.manifest
File versionNot applicable
File size1,100
Date (UTC)19-Aug-2013
Time (UTC)19:58
PlatformNot applicable
File nameAmd64_c6aa2b4192ff2dd7c63a5a1f9c44027f_31bf3856ad364e35_9.1.8112.20618_none_5d44d6c0288cb429.manifest
File versionNot applicable
File size1,062
Date (UTC)19-Aug-2013
Time (UTC)19:58
PlatformNot applicable
File nameAmd64_microsoft-windows-i..tocolimplementation_31bf3856ad364e35_9.1.8112.20618_none_1e963a94b123fb8f.manifest
File versionNot applicable
File size41,090
Date (UTC)18-Aug-2013
Time (UTC)12:00
PlatformNot applicable
File nameAmd64_microsoft-windows-ie-runtimeutilities_31bf3856ad364e35_9.1.8112.20618_none_6450f1709bd519ec.manifest
File versionNot applicable
File size4,527
Date (UTC)18-Aug-2013
Time (UTC)12:00
PlatformNot applicable
File nameX86_microsoft-windows-i..tocolimplementation_31bf3856ad364e35_9.1.8112.20618_none_c2779f10f8c68a59.manifest
File versionNot applicable
File size41,086
Date (UTC)18-Aug-2013
Time (UTC)10:59
PlatformNot applicable
File nameX86_microsoft-windows-ie-runtimeutilities_31bf3856ad364e35_9.1.8112.20618_none_083255ece377a8b6.manifest
File versionNot applicable
File size4,525
Date (UTC)18-Aug-2013
Time (UTC)10:59
PlatformNot applicable
Propriétés

ID d'article : 2839111 - Dernière mise à jour : 26 janv. 2014 - Révision : 1

Commentaires