windows: Only attempt to bind when the network interface is up (#1527)

Previously if the system had an interface with a static IP configured,
coturn would attempt to bind to that address, even if the interface was
down. This would fail, and prevent coturn from starting (even if there
were other usable interfaces)
This commit is contained in:
David Smitmanis 2024-07-27 07:22:25 +02:00 committed by GitHub
parent 00ce90cee0
commit 1f74024a30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -327,6 +327,12 @@ static int make_local_listeners_list(void) {
printf("\tIfIndex (IPv4 interface): %u\n", pCurrAddresses->IfIndex);
printf("\tAdapter name: %s\n", pCurrAddresses->AdapterName);//*/
if (pCurrAddresses->OperStatus != IfOperStatusUp)
{
pCurrAddresses = pCurrAddresses->Next;
continue;
}
pUnicast = pCurrAddresses->FirstUnicastAddress;
if (pUnicast != NULL) {
// printf("\tNumber of Unicast Addresses:\n");
@ -596,6 +602,12 @@ static int make_local_relays_list(int allow_local, int family) {
printf("\tIfIndex (IPv4 interface): %u\n", pCurrAddresses->IfIndex);
printf("\tAdapter name: %s\n", pCurrAddresses->AdapterName);//*/
if (pCurrAddresses->OperStatus != IfOperStatusUp)
{
pCurrAddresses = pCurrAddresses->Next;
continue;
}
pUnicast = pCurrAddresses->FirstUnicastAddress;
if (pUnicast != NULL) {
// printf("\tNumber of Unicast Addresses:\n");