Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

The first-returned IP address is incorrect when you use the getaddrinfo function on a multi-homed computer that is running Windows Vista, Windows Server 2008, Windows 7, or Windows Server 2008 R2


View products that this article applies to.

Symptoms

Consider the following scenario:
  • Multiple network adapters are installed on a computer.
  • One network adapter is configured to use an Automatic Private Internet Protocol Addressing (APIPA) IP address.
  • Another network adapter is configured to use a non-APIPA IP address.
  • The interface metric is smaller on the second network adapter than the metric that is configured on the first network adapter.
  • An application calls the getaddrinfo function on the computer.
In this scenario, the first-returned IP address is the APIPA IP address.

Notes
  • This issue prevents network applications that use only the first-returned local IP address by calling the getaddrinfo function (such as a Java-based application that calls the GetLocalHost Java API) from connecting to network resources.
  • This issue occurs on a computer that is running one of the following operating systems:
    • Windows Vista Service Pack 2 (SP2)
    • Windows Server 2008 Service Pack 2 (SP2)
    • Windows 7
    • Windows 7 Service Pack 1 (SP1)
    • Windows Server 2008 R2
    • Windows Server 2008 R2 Service Pack 1 (SP1)

↑ Back to the top


Cause

The issue occurs because the TCP/IP driver (Tcpip.sys) incorrectly ignores the interface metric when it determines which IP address should be returned first. The expected behavior is that the first-returned IP address should be the interface that has the smallest metric and is therefore the highest priority.

↑ Back to the top


Resolution

This hotfix is to partly restore the previous sorting behavior that was implemented in the release version of Windows Server 2008. For both IPv4 and IPv6 scenarios, IP addresses will first be sorted by the interface metric. However, if there are two or more network adapters that have identical interface metrics, then the address "scope" value will be used to sort IP addresses. According to RFC 3484, the APIPA IP addresses (169.254.x.x) are favored over the global IP addresses. �

Note The IPv6 address sorting method is also changed because the same sorting algorithm is used for both IPv4 and IPv6 addresses.

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 Web site: 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 be running one of the following operating systems:
  • Windows Vista Service Pack 2 (SP2)
  • Windows Server 2008 Service Pack 2 (SP2)
  • Windows 7
  • Windows 7 Service Pack 1 (SP1)
  • Windows Server 2008 R2
  • Windows Server 2008 R2 Service Pack 1 (SP1)
For more information about how to obtain a Windows Vista service pack, click the following article number to view the article in the Microsoft Knowledge Base:
935791 How to obtain the latest Windows Vista service pack
For more information about how to obtain a Windows Server 2008 service pack, click the following article number to view the article in the Microsoft Knowledge Base:
968849 How to obtain the latest service pack for Windows Server 2008
For more information about how to obtain a Windows 7 or Windows Server 2008 R2 service pack, click the following article number to view the article in the Microsoft Knowledge Base:
976932 Information about Service Pack 1 for Windows 7 and for Windows Server 2008 R2

Registry information

To use the hotfix in this package, you do not have to make any changes to the registry.

Restart requirement

You must restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information

The global version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.
Windows Vista and Windows Server 2008 file information notes
Important Windows Vista hotfixes and Windows Server 2008 hotfixes are included in the same packages. However, only "Windows Vista" is listed on the Hotfix Request page. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under "Windows Vista" on the page. Always refer to the "Applies To" section in articles to determine the actual operating system that each hotfix applies to.
  • The files that apply to a specific product, SR_Level (RTM, SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table.
    VersionProductSR_LevelService branch
    6.0.600 2 . 22xxxWindows Vista and Windows Server 2008SP2LDR
  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the "Additional file information for Windows Server 2008 and for Windows Vista" section. MUM files and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintain the state of the updated components. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows Server 2008 and of Windows Vista
File nameFile versionFile sizeDateTimePlatform
Tcpipreg.sys6.0.6002.2272331,23205-Oct-201114:04x86
Tcpip.sys6.0.6002.22723913,28005-Oct-201119:14x86
For all supported x64-based versions of Windows Server 2008 and of Windows Vista
File nameFile versionFile sizeDateTimePlatform
Tcpipreg.sys6.0.6002.2272340,44805-Oct-201114:57x64
Tcpip.sys6.0.6002.227231,423,23205-Oct-201119:10x64
For all supported IA-64-based versions of Windows Server 2008
File nameFile versionFile sizeDateTimePlatform
Tcpipreg.sys6.0.6002.2272380,89605-Oct-201115:01IA-64
Tcpip.sys6.0.6002.227232,968,96005-Oct-201119:05IA-64
Windows 7 and Windows Server 2008 R2 file information notes
  • The files that apply to a specific product, milestone (RTM, SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table:
    VersionProductMilestoneService branch
    6.1.760 0.16xxxWindows 7 and Windows Server 2008 R2RTMGDR
    6.1.760 0.21xxxWindows 7 and Windows Server 2008 R2RTMLDR
    6.1.760 1.17xxxWindows 7 and Windows Server 2008 R2SP1GDR
    6.1.760 1.21xxxWindows 7 and Windows Server 2008 R2SP1LDR
  • GDR service branches contain only those fixes that are widely released to address widespread, extremely important issues. LDR service branches contain hotfixes in addition to widely released fixes.
  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the "Additional file information for Windows Server 2008 R2 and for Windows 7" section. MUM and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintain the state of the updated components. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows 7
File nameFile versionFile sizeDateTimePlatform
Tcpip.sys6.1.7600.168941,285,48806-Oct-201104:54x86
Fwpkclnt.sys6.1.7600.21065187,24806-Oct-201104:36x86
Tcpip.sys6.1.7600.210651,301,87206-Oct-201104:35x86
Tcpip.sys6.1.7601.177021,290,60806-Oct-201104:28x86
Fwpkclnt.sys6.1.7601.21833187,76006-Oct-201106:14x86
Tcpip.sys6.1.7601.218331,303,92006-Oct-201106:14x86
For all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
Tcpip.sys6.1.7600.168941,897,32806-Oct-201105:26x64
Fwpkclnt.sys6.1.7600.21065288,11206-Oct-201105:35x64
Tcpip.sys6.1.7600.210651,886,06406-Oct-201105:36x64
Tcpip.sys6.1.7601.177021,923,95206-Oct-201105:52x64
Fwpkclnt.sys6.1.7601.21833288,62406-Oct-201106:04x64
Tcpip.sys6.1.7601.218331,912,68806-Oct-201106:04x64
For all supported IA-64-based versions of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
Tcpip.sys6.1.7600.168943,782,00006-Oct-201104:14IA-64
Fwpkclnt.sys6.1.7600.21065482,67206-Oct-201104:23IA-64
Tcpip.sys6.1.7600.210653,805,55206-Oct-201104:23IA-64
Tcpip.sys6.1.7601.177023,789,16806-Oct-201104:11IA-64
Fwpkclnt.sys6.1.7601.21833483,18406-Oct-201104:25IA-64
Tcpip.sys6.1.7601.218333,808,11206-Oct-201104:25IA-64

↑ Back to the top


Workaround

To work around this issue, add an explicit entry for the local node name into the hosts file. For example, if a local host is named "Server123" and is configured by using a static IPv4 address of 157.59.120.69 (global IP address) and a dynamic IPv4 address of 169.254.20.10 (APIPA IP address), the following line should be added to the hosts file that is located under C:\Windows\System32\drivers\etc\:
server123 157.59.120.69

↑ Back to the top


Status

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

↑ Back to the top


More information

Starting from Windows Server 2008 SP2, a change was made in the behavior of sorting local IP addresses that are returned by the getaddrinfo API call. This change causes the IPv4 APIPA IP address to always be the first address that is returned by the getaddrinfo API call.

Notes
  • The GetLocalHost Java API is mapped to the getaddrinfo API in Windows.
  • The getaddrinfo API does not specify any specific sorting behavior. Therefore, these affected applications implicitly assumed a sorting order. Microsoft does not guarantee any particular destination address sorting order by using the getaddrinfo API.
The interface metric was previously implemented to sort the IP addresses that are returned by the getaddrinfo API call. However, this behavior was changed because of an unrelated hotfix that was implemented in Dec 2008. This hotfix fixed the sorting method of IPv6 destination addresses in order to comply with RFC 3484. Instead of the interface metric, a different sorting method was implemented. This method has become the default method starting from Windows Server 2008 SP2. This hotfix corrected an issue in which Windows incorrectly favored an Intra-site Automatic Tunnel Addressing Protocol�(ISATAP) address over a native IPv6 address. Therefore, the sorting method for IPv4 addresses was changed because a common sorting routine was implemented in Tcpip.sys that handles both IPv6 and IPv4 addresses (in an address-agnostic manner). This hotfix changes the sorting method to use the address "scope" value instead of the interface metric to sort IP addresses (IPv4 APIPA IP addresses are favored over global IP addresses).

For more information about the interface metric values that are implemented in Windows, click the following article number to view the article in the Microsoft Knowledge Base:
299540 An explanation of the Automatic Metric feature for Internet Protocol routes
Notes
  • You can directly configure the interface metric value for an interface by using the netsh command at an administrative command prompt. The interface metric can be set for a specific interface. For example, the following command sets the interface metric for "Local Area Connection" interface to 15:
    netsh interface ipv4 set interface "Local Area Connection" metric=15
  • You can list all interfaces by using the following command:
    netsh interface ipv4 show interfaces
  • You can view the current interface values of the "Local Area Connection" interface by using the following command:
    netsh interface ipv4 show interface "Local Area Connection"
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

Additional file information

Additional file information for Windows Vista and for Windows Server 2008

Additional files for all supported x86-based versions of Windows Vista and of Windows Server 2008
File nameX86_7cc89ee31e50ab74a34d57e217e3b33b_31bf3856ad364e35_6.0.6002.22723_none_1383f57d6aa19080.manifest
File versionNot Applicable
File size717
Date (UTC)05-Oct-2011
Time (UTC)19:20
File nameX86_a5ccb1358fedfe55216468e0e8b5231a_31bf3856ad364e35_6.0.6002.22723_none_2b562c498bedff79.manifest
File versionNot Applicable
File size702
Date (UTC)05-Oct-2011
Time (UTC)19:20
File nameX86_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.22723_none_887ab6d61bbe59c0.manifest
File versionNot Applicable
File size4,845
Date (UTC)05-Oct-2011
Time (UTC)16:19
File nameX86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.22723_none_b57b93217cb7a02a.manifest
File versionNot Applicable
File size6,762
Date (UTC)05-Oct-2011
Time (UTC)19:20
Additional files for all supported x64-based versions of Windows Vista and of Windows Server 2008
File nameAmd64_8284ad97a9ed82c3edba4aaa38e9180c_31bf3856ad364e35_6.0.6002.22723_none_1a9349b5fe9d5533.manifest
File versionNot Applicable
File size721
Date (UTC)05-Oct-2011
Time (UTC)19:20
File nameAmd64_d10eeafde7169c8cafc664316259523f_31bf3856ad364e35_6.0.6002.22723_none_8677a28a0729041f.manifest
File versionNot Applicable
File size706
Date (UTC)05-Oct-2011
Time (UTC)19:20
File nameAmd64_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.22723_none_e4995259d41bcaf6.manifest
File versionNot Applicable
File size5,122
Date (UTC)05-Oct-2011
Time (UTC)16:55
File nameAmd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.22723_none_119a2ea535151160.manifest
File versionNot Applicable
File size6,784
Date (UTC)05-Oct-2011
Time (UTC)19:20
Additional files for all supported IA-64-based versions of Windows Server 2008
File nameIa64_0d25a89ad7af4f79e612511515b2ccaf_31bf3856ad364e35_6.0.6002.22723_none_027b90c881069b66.manifest
File versionNot Applicable
File size1,066
Date (UTC)05-Oct-2011
Time (UTC)19:20
File nameIa64_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.22723_none_887c5acc1bbc62bc.manifest
File versionNot Applicable
File size5,118
Date (UTC)05-Oct-2011
Time (UTC)16:36
File nameIa64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.22723_none_b57d37177cb5a926.manifest
File versionNot Applicable
File size6,773
Date (UTC)05-Oct-2011
Time (UTC)19:20

Additional file information for Windows 7 and for Windows Server 2008 R2

Additional files for all supported x86-based versions of Windows 7
File nameX86_1f2d67e9888700c090fa30efdce91bbd_31bf3856ad364e35_6.1.7600.21065_none_c59065e9424e8151.manifest
File versionNot Applicable
File size702
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameX86_6563ea55f14e77fb940dce9c246aec3c_31bf3856ad364e35_6.1.7600.16894_none_e67d74b7bb432ab7.manifest
File versionNot Applicable
File size702
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameX86_6c1ae23b0042d804afa649f3a34fbbf0_31bf3856ad364e35_6.1.7601.21833_none_5e94f09402426400.manifest
File versionNot Applicable
File size702
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameX86_a1e1a1a54b86ff7c64e96e177a1e7003_31bf3856ad364e35_6.1.7601.17702_none_58205a8d4fc414fe.manifest
File versionNot Applicable
File size702
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameX86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.16894_none_b2e8a1bdc7c2cac4.manifest
File versionNot Applicable
File size3,780
Date (UTC)06-Oct-2011
Time (UTC)09:19
File nameX86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.21065_none_b39386b8e0c76354.manifest
File versionNot Applicable
File size3,834
Date (UTC)06-Oct-2011
Time (UTC)05:01
File nameX86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.17702_none_b52e4f61c4a205b0.manifest
File versionNot Applicable
File size3,780
Date (UTC)06-Oct-2011
Time (UTC)09:19
File nameX86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.21833_none_b5987cb2ddd712a4.manifest
File versionNot Applicable
File size3,834
Date (UTC)06-Oct-2011
Time (UTC)06:49
Additional files for all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
File nameAmd64_08410fec34e5cfbd5a73977749439d91_31bf3856ad364e35_6.1.7601.21833_none_77cbb2dc734d8217.manifest
File versionNot Applicable
File size706
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameAmd64_b6266af7ff6d267f9c2ea77668f88607_31bf3856ad364e35_6.1.7601.17702_none_d02758de84b7e37d.manifest
File versionNot Applicable
File size706
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameAmd64_be805298174f0b3dc56a1a5ce0a5179c_31bf3856ad364e35_6.1.7600.21065_none_0c18d02e343ab905.manifest
File versionNot Applicable
File size706
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameAmd64_dc9c6e91046a3b6a5f5471b90c6ab7cd_31bf3856ad364e35_6.1.7600.16894_none_26c730af571d2409.manifest
File versionNot Applicable
File size706
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameAmd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.16894_none_0f073d4180203bfa.manifest
File versionNot Applicable
File size3,784
Date (UTC)06-Oct-2011
Time (UTC)09:23
File nameAmd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.21065_none_0fb2223c9924d48a.manifest
File versionNot Applicable
File size3,838
Date (UTC)06-Oct-2011
Time (UTC)06:02
File nameAmd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.17702_none_114ceae57cff76e6.manifest
File versionNot Applicable
File size3,784
Date (UTC)06-Oct-2011
Time (UTC)09:23
File nameAmd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.21833_none_11b71836963483da.manifest
File versionNot Applicable
File size3,838
Date (UTC)06-Oct-2011
Time (UTC)07:22
Additional files for all supported IA-64-based versions of Windows Server 2008 R2
File nameIa64_1275d8933ddca5c6e2f516cd5905342b_31bf3856ad364e35_6.1.7600.16894_none_6cbbcdafeac0dbf5.manifest
File versionNot Applicable
File size704
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_7261f1e4e9a5535a81c6346cc8c060f3_31bf3856ad364e35_6.1.7601.21833_none_8753b88431795b32.manifest
File versionNot Applicable
File size704
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_c3b26b05608ef5a0ec28c2a2b3b3fead_31bf3856ad364e35_6.1.7600.21065_none_8255801d2bf80809.manifest
File versionNot Applicable
File size704
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_e1ea02dfe972ac45871597433e75f160_31bf3856ad364e35_6.1.7601.17702_none_8b7b4fdf615bfe48.manifest
File versionNot Applicable
File size704
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.16894_none_b2ea45b3c7c0d3c0.manifest
File versionNot Applicable
File size3,782
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7600.21065_none_b3952aaee0c56c50.manifest
File versionNot Applicable
File size3,836
Date (UTC)06-Oct-2011
Time (UTC)06:02
File nameIa64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.17702_none_b52ff357c4a00eac.manifest
File versionNot Applicable
File size3,782
Date (UTC)06-Oct-2011
Time (UTC)09:16
File nameIa64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.1.7601.21833_none_b59a20a8ddd51ba0.manifest
File versionNot Applicable
File size3,836
Date (UTC)06-Oct-2011
Time (UTC)07:15

↑ Back to the top


Keywords: kbautohotfix, kbqfe, kbhotfixserver, kbfix, kbsurveynew, kbexpertiseinter, KB2621067

↑ Back to the top

Article Info
Article ID : 2621067
Revision : 1
Created on : 12/14/2011
Published on : 12/14/2011
Exists online : False
Views : 500