setsockopt(IP_MULTICAST_IF) fails with WSAEADDRNOTAVAIL if Ethernet port was never connected

Heesterman, Peter J 1 Reputation point
2020-12-17T10:16:34.777+00:00

I am setting multicast to operate over a specific net port.
(The PC has more than one.)

The port is configured with a static IP address, which is correctly passed to the setsockopt function.

This works correctly if the port has been physically connected at any time since the PC booted.

However, if the network port was never physically connected (after boot) it fails with error 10049 (WSAEADDRNOTAVAIL).

Is this the intended behaviour?

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,570 questions
0 comments No comments
{count} votes