linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wen Guangcheng" <wen.guangcheng@cnt.sp.qnes.nec.co.jp>
To: linux-c-programming@vger.kernel.org
Subject: Question on socket of broadcast
Date: Thu, 18 Mar 2004 20:15:11 +0900	[thread overview]
Message-ID: <012901c40cda$47c51a40$de01a8c0@qnessmphibiki> (raw)

Hello,
I create a socket for broadcast by

dhcpSocket = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL));
setsockopt(dhcpSocket, SOL_SOCKET, SO_BROADCAST, &flags, sizeof(int *));

and send a message by

sendto(dhcpSocket,&UdpIpMsgSend,sizeof(struct packed_ether_header)+
    sizeof(udpiphdr)+sizeof(dhcpMessage),0,
    &addr,sizeof(struct sockaddr)

then receive a replied broadcast message by

recvfrom(dhcpSocket,&UdpIpMsgRecv,sizeof(udpipMessage),0,(struct sockaddr
*)&addr,&i);

It works well on normal LAN. But on a wireless LAN the message
which was sent by the socket. is received from itself.
Should a message sent by broadcast socket be recieved by itself?

Thanks in advance.

--Wen


                 reply	other threads:[~2004-03-18 11:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='012901c40cda$47c51a40$de01a8c0@qnessmphibiki' \
    --to=wen.guangcheng@cnt.sp.qnes.nec.co.jp \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).