UDP broadcast source address when > 1 NIC



My PC (XP Pro SP2) has two Ethernet interfaces, 10.0.0.6 and 192.168.0.200,
both IPs are static.

When I broadcast a UDP datagram using sendto() and a destination of
255.255.255.255, it sends the UDP datagram out on both Ethernet interfaces
which is what I wanted.

Unfortunately it uses the same IP source address (192.168.0.200) on both
interfaces, which isn't what I wanted.

I expected it to send the broadcast from the 10.0.0.6 interface with a
source address of 10.0.0.6.

The receiver of my broadcast uses recvfrom() and then sendto() to send a
directed reply to the broadcast, but of course this doesn't work on the
10.0.x.y network because the reply is being sent to 192.168.0.200.

I'm thinking that I'll have to enumerate the network interfaces and
broadcast on each one using sendto() with the sub-net broadcast address.

Is there any other way to get Windows to send out the broadcast on each
Ethernet interface but use the IP address assigned to the interface as the
source IP ?

TIA

Dave.



.



Relevant Pages

  • Re: Odd routing problem
    ... >practice serves only the wireless connection for my son. ... broadcast ntp udp packets for 192.168.1 ... particular if ntpd was restarted while xl0 was down and hasn't been ... address is for the respective interfaces. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: how to disallow nis-client to broadcast on certain interfaces
    ... Did you look at implementing NIS securnets by using the file ... how to disallow nis-client to broadcast on certain interfaces ...
    (AIX-L)
  • Re: single host netmask (255.255.255.255)
    ... The routes from three interfaces, propagate via OSPF to the rest of network.... ... One way is to remember IP addresses assigned to each interfaces, but more smart solution is to assign to this machine one EXTERNAL LOOPBACK address (single IP with mask 255.255.255.255, in other words SINGLE HOST assigned to Microsoft loopback adapter), and propagate this address ... The address 255.255.255.255 denotes a broadcast on a local hardware network, ...
    (microsoft.public.win2000.networking)
  • routes disappear
    ... netstat to report no routes. ... the latest box to do this has two interfaces (this one has tg3 interfaces, ... full duplex. ... code 1 error to a broadcast: ...
    (Linux-Kernel)
  • Re: UDP broadcast source address when > 1 NIC
    ... >> When I broadcast a UDP datagram using sendtoand a destination of ... it sends the UDP datagram out on both Ethernet ... >> interfaces, ... > o Do a sendto() for each subnet broadcast address in the above list. ...
    (microsoft.public.win32.programmer.networks)