Re: UDP broadcast source address when > 1 NIC
- From: "Dave Lowther" <davel@xxxxxxxxx>
- Date: Wed, 24 Aug 2005 09:05:21 +0100
"Dave Lowther" <davel@xxxxxxxxx> wrote
> 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'd still like to know whether the above is expected behaviour or not ?
Since my OP I've implemented a solution like this which works fine but seems
over complicated:
o Enumerate the network interfaces and make a list of all IP (addresses,
masks) on the PC
o From the above list, make a list of subnet broadcast addresses and remove
any duplicates
o Do a sendto() for each subnet broadcast address in the above list.
Now my broadcasts get sent with the 'correct' source IP address and the
receivers can reply ok.
Dave.
.
- Follow-Ups:
- Re: UDP broadcast source address when > 1 NIC
- From: Arkady Frenkel
- Re: UDP broadcast source address when > 1 NIC
- References:
- UDP broadcast source address when > 1 NIC
- From: Dave Lowther
- UDP broadcast source address when > 1 NIC
- Prev by Date: Re: how can i get the right dhcp state of the network adapter in winme
- Next by Date: RE: Mailslots: Difference between NT4 and Windows 2000/XP
- Previous by thread: UDP broadcast source address when > 1 NIC
- Next by thread: Re: UDP broadcast source address when > 1 NIC
- Index(es):
Relevant Pages
|
Loading