* Question on socket of broadcast
@ 2004-03-18 11:15 Wen Guangcheng
0 siblings, 0 replies; only message in thread
From: Wen Guangcheng @ 2004-03-18 11:15 UTC (permalink / raw)
To: linux-c-programming
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-03-18 11:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-18 11:15 Question on socket of broadcast Wen Guangcheng
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).