I have two interfaces IF-A:10.0.0.1 and IF-B:172.20.29.152.
Sending broadcasts to both interfaces should generate 2 packets:
var udp = new UdpClient();
var target1 = IPAddress.Parse("10.255.255.255");
var target2 = IPAddress.Parse("172.20.255.255");
udp.Send(new byte[0], 0, new IPEndPoint(target1, 80));
udp.Send(new byte[0], 0, new IPEndPoint(target2, 80));
I ran wireshark and saw that 4 Packets went out from my pc. I found out, that each call of "udpClient.Send" creates TWO identical packets - one for each interface:
// First Send()
IF-A: from 10.0.0.1 to 10.255.255.255 (OK)
IF-B: from 10.0.0.1 to 10.255.255.255 (WTF?)
// Second Send()
IF-A: from 172.20.29.152 to 172.20.255.255 (WTF?)
IF-B: from 172.20.29.152 to 172.20.255.255 (OK)
This makes absolutely no sense to me.
Details:
Packet dump (4 Packets): http://pastebin.com/i71NZhaU