Reputation: 598
I'm working on a project that discovers/configures remote devices using UDP broadcasts. These devices may not have IP addresses configured yet, at least no to match the network they are connected to. Currently we use a single sendto
with a target address of 255.255.255.255
. This works fine in most cases but on Vista machines with multiple NICs the broadcast only seems to be sent out one of the interfaces. How can I get Vista to send the broadcast to all interfaces?
Upvotes: 2
Views: 1870
We have the exact same problem, only we can't use subnet broadcasts, as we want to configure them. If a device has a wrong IP (outside our range), sending a subnet broadcast to it will never be accepted by its IP stack. Nasty problem, unless we allow DHCP...
Upvotes: 1
Reputation: 4536
Enumerate the interfaces and then send the packet once on each interface.
Upvotes: 1
Reputation: 339776
I've personally never seen any system generate a packet for every interface in response to a single sendto
call.
A better option would be to enumerate the network interfaces, determine the correct link-local broadcast and send a separate packet individually via each interface.
Upvotes: 2