Background
At the beginning of my program I build a linked list of adapter interface addresses using GetAdaptersAddresses. Later, after creating an ipv6 slaac
address, calling Socket()
, Bind()
and Listen()
all succeed where the IfType
is Wireless, that is, IfType
71 (IF_TYPE_IEEE80211
). My filter parameters are family
and ifType
. I test by connecting and disconnecting the ethernet cable. For each case my software finds the active interface with said parameters: connected it finds ethernet first, disconnected it doesn't find ethernet, then looks further for a wireless interface. See SO Unable to GetUnicastIpAddressEntry after CreateUnicastIpAddressEntry for relevant code snippets.
Problem
However, if the interface's IfType
is 6 (IF_TYPE_ETHERNET_CSMACD
), Socket()
succeeds, but Bind()
and of course Listen()
then fails.
Question
Are there any other factors or interface parameters I have left out that can determine the outcome?
Attempt1
Cycle through all ipv6 interfaces just to empirically determine if any would succeed. None did on two machines.
Attempt2
Looked for scope id
and append that to address, however, I didn't see the scope id
parameter in the interface linked list.