For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2006 > Re: receive broadcasts on INADDR_ANY on the same machine does not









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: receive broadcasts on INADDR_ANY on the same machine does not
saju

2006-08-22, 9:59 pm

linux62i@yahoo.com wrote:
> Hello,
>
> I have got a problem with receiving broadcasted (to 255.255.255.255)
> packets.
> I receive such packets on INADDR_ANY on the same host and on remote one
>
> via normal UDP sockets (all things like setting flags for broadcast are
>
> ok).
> If I use UDP datagramm sockets for _sending_ everything is caught on
> both
> machines. If I use PF_PACKET and assemble packet myself one-to-one
> matching the datagramm and send it I only receive the broadcast on
> remote host.
> I can see packets with tcpdump - they are identical. Everything happens
>
> on eth0.
>
>
> Linux 2.6.9.
>
>
> What could be the problem and how can I workaround it? I would like
> to leave receiver using simpel UDP sockets not going into PF_PACKET...



Try setting the IP_MULTICAST_LOOP option to 0 with setsockopt() for the
udp socket.

regards
srp

--
I will never get off this planet
- Luke Skywalker
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com