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?
views:
588answers:
3
+2
A:
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.
Alnitak
2009-03-20 14:53:24
I'm not sure link local addresses will work since not all devices have IP's configured for the link's subnet.
megabytephreak
2009-03-20 15:43:03
+1
A:
Enumerate the interfaces and then send the packet once on each interface.
WaldenL
2009-03-20 15:09:59
A:
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...