Subject: Sending broadcast UDP packet
To: None <netbsd-users@NetBSD.org>
From: None <amitg@hss.hns.com>
List: netbsd-users
Date: 12/25/2003 13:08:32
Hi All,

I need some help in sending IPv4 broadcast packet UDP packet from a netbsd
machine 1.6.1 version.
My requirement is that i want to send out broadcast packet from a specific
interface and it should have the sopurce address
as the primary address of that interface.

FOr this i am taking the following stepos:
1. Opening a socket
2. binding the socket with IP address INETADDR_ANY
3. enabling SO_BRODCAST by calling the respective socket option.
4. Setting the outgoing interface with setsockopt to specify outgoing
interface for multicast apcket
5. Setting the destination address 0xffffffff.

Unfortunately  i am not getting the desired output. What is happening is

1. Destination address is changed to the interface brodcast address. This
too also not of the interface i have specified using socket option but of
the
    first interface created in the system.
2. Source address is choosen as the primary address of the interface whose
broadcast address is assigned to the packet.

I need some help to resolve this. Do i need to make some changes in the
netbsd kernel to support this or i am missing some steps in the socket
application
to take care of this.

Pls let me know if you have some useful pointers regarding this.  I need it
urgently.

Thanx in Advance
Amit


"DISCLAIMER: This message is proprietary to Hughes Software Systems Limited
(HSS) and is intended solely for the use of the individual to whom it is
addressed. It may contain  privileged or confidential information and
should not be circulated or used for any purpose other than for what it is
intended. If you have received this message in error, please notify the
originator immediately. If you are not the intended recipient, you are
notified that you are strictly prohibited from using, copying, altering, or
disclosing the contents of this message. HSS accepts no responsibility for
loss or damage arising from the use of the information transmitted by this
email including damage from virus."