Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6124875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:10:59+00:00 2026-05-23T16:10:59+00:00

If you take the MSDN example inside IP_ADAPTER_ADDRESSES Structure on Windows 7 SP1 then

  • 0

If you take the MSDN example inside IP_ADAPTER_ADDRESSES Structure on Windows 7 SP1 then expand out enumeration of unicast addresses:

char s[1024];
for (i = 0; pUnicast != NULL; i++) {
  inet_ntop (pUnicast->Address.lpSockaddr->sa_family,
      pUnicast->Address.lpSockaddr->sa_family == AF_INET ?
      (PVOID)&((struct sockaddr_in*)pUnicast->Address.lpSockaddr)->sin_addr :
      (PVOID)&((struct sockaddr_in6*)pUnicast->Address.lpSockaddr)->sin6_addr,
      s, sizeof (s));
  printf ("\t#%lu %s/%u\n",
      i, s, (unsigned)pUnicast->OnLinkPrefixLength);
  pUnicast = pUnicast->Next;
}

and prefix details:

char s[1024];
for (i = 0; pPrefix != NULL; i++) {
  inet_ntop (pPrefix->Address.lpSockaddr->sa_family,
      pPrefix->Address.lpSockaddr->sa_family == AF_INET ?
      (PVOID)&((struct sockaddr_in*)pPrefix->Address.lpSockaddr)->sin_addr :
      (PVOID)&((struct sockaddr_in6*)pPrefix->Address.lpSockaddr)->sin6_addr,
      s, sizeof (s));
  printf ("\t#%lu %s/%u\n",
      i, s, pPrefix->PrefixLength);
  pPrefix = pPrefix->Next;
}

But one adapter shows the following output:

Length of the IP_ADAPTER_ADDRESS struct: 376
IfIndex (IPv4 interface): 15
Adapter name: {84C25EC1-7ABB-4D6E-B8C7-8DEE08961EE2}
#0 2001:0:4137:9e76:2443:d6:ba87:1a2a/64
#1 fe80::2443:d6:ba87:1a2a/64
Number of Unicast Addresses: 2
...
#0 ::/0
#1 2001::/32
#2 2001:0:4137:9e76:2443:d6:ba87:1a2a/128
#3 fe80::/64
#4 fe80::2443:d6:ba87:1a2a/128
#5 ff00::/8
Number of IP Adapter Prefix entries: 6

The prefix list is correct, albeit slightly expanded over MSDN’s description of 3 addresses:

On Windows Vista and later, the linked
IP_ADAPTER_PREFIX structures pointed
to by the FirstPrefix member include
three IP adapter prefixes for each IP
address assigned to the adapter. These
include the host IP address prefix,
the subnet IP address prefix, and the
subnet broadcast IP address prefix. In
addition, for each adapter there is a
multicast address prefix and a
broadcast address prefix.

I determine the list is correct by comparing with the output of netstat -r:

IPv6 Route Table
==================================================
Active Routes:
 If Metric Network Destination      Gateway
 15     58 ::/0                     On-link
  1    306 ::1/128                  On-link
 15     58 2001::/32                On-link
 15    306 2001:0:4137:9e76:2443:d6:ba87:1a2a/128
                                    On-link
 14    281 fe80::/64                On-link
 15    306 fe80::/64                On-link
 15    306 fe80::2443:d6:ba87:1a2a/128
                                    On-link
 14    281 fe80::6153:a573:f691:8167/128
                                    On-link
  1    306 ff00::/8                 On-link
 15    306 ff00::/8                 On-link
 14    281 ff00::/8                 On-link
==================================================

However my interpretation of the API is that OnLinkPrefixLength should return 32 for the global-scope unicast address but the Vista+ only API is returning 64, why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:10:59+00:00Added an answer on May 23, 2026 at 4:10 pm

    A bit of background information:
    There are a few default prefix lengths for IPv6. A LAN usually has a prefix length of 64. The link local addresses you see (fe80::/64) are examples of that. The addresses of your own system show up as single addresses in the routing table (/128). The multicast addresses are special (ff00::/8) as they don’t correspond to one address of one host but to a group of multiple hosts on potentially multiple networks.

    The /32 you are seeing is the Teredo address block (2001:0000::/32 == 2001::/32). Teredo is a IPv6-in-IPv4 tunneling protocol that Windows automatically configures. The routing table shows that your default IPv6 route (::/0) is through the Teredo adapter. Your system doesn’t seem to have ‘normal’ IPv6 global unicast.

    Summary:
    The on-link-prefix-length is usually /64. Teredo is a special case and uses a fixed ‘special’ /32. Your own IPv6 addresses are complete and have a prefix length of /128.

    You are right in that 2001:0:4137:9e76:2443:d6:ba87:1a2a/64 doesn’t make sense. It is Teredo so it should have a network prefix length of /32. If it is a single IPv6 address it should have a prefix length of /128. The /64 does not make sense for Teredo and seems to be a bug.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take the following string as an example: The quick brown fox Right now the
Take the following generics example import java.util.List; import java.util.ArrayList; public class GenericsTest { private
MSDN said that BlockingCollection.Take call blocks if there is no elements in it. Does
Using the method described in the MSDN for registering a Windows Service (ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.WIN32COM.v10.en/dllproc/base/createservice.htm) and
Here is an example of using a SqlUserDefinedAggregate : http://msdn.microsoft.com/en-us/library/91e6taax(v=vs.80).aspx Which allows you to
Per MSDN: A static constructor does not take access modifiers or have parameters. A
Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if
Take the following snippet: List<int> distances = new List<int>(); Was the redundancy intended by
Take a look at the ssl_requirement plugin. Shouldn't it check to see if you're
Take a .Net Winforms App.. mix in a flakey wireless network connection, stir with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.