* Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip
@ 2007-05-02 9:55 Dylan Taft
2007-05-02 10:14 ` Eric Dumazet
2007-05-02 10:30 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dylan Taft @ 2007-05-02 9:55 UTC (permalink / raw)
To: linux-kernel
I've been pulling my hair out for the past several hours trying to
debug a program in wine. I'm currently on kernel 2.6.20.8. The
problem was that I was not getting any broadcasts to 255.255.255.255
on a UDP socket bound to 192.168.0.8 with SO_BROADCAST enabled.
I was fiddling around a bit, broadcasts come in fine if the socket is
bound to INADDR_ANY( 0.0.0.0), but if it's bound to 192.168.0.8
nothing comes in. I did a packet sniff, and indeed packets were being
sent out to 255.255.255.255 via another machine on the network. I
wrote a quick test program that would bind a socket to the lan ip and
wait for incoming data. I tested it on a windows machine and linux.
The windows machine could pick up packets fine, my linux machine could
not. Is this proper behavior? It's fudging up several games and
things in the wine project.
Does anyone else experience this? Thanks!
Dylan Taft
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip
2007-05-02 9:55 Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip Dylan Taft
@ 2007-05-02 10:14 ` Eric Dumazet
2007-05-02 10:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2007-05-02 10:14 UTC (permalink / raw)
To: Dylan Taft; +Cc: linux-kernel
On Wed, 2 May 2007 05:55:28 -0400
"Dylan Taft" <d13f00l@gmail.com> wrote:
> I've been pulling my hair out for the past several hours trying to
> debug a program in wine. I'm currently on kernel 2.6.20.8. The
> problem was that I was not getting any broadcasts to 255.255.255.255
> on a UDP socket bound to 192.168.0.8 with SO_BROADCAST enabled.
>
> I was fiddling around a bit, broadcasts come in fine if the socket is
> bound to INADDR_ANY( 0.0.0.0), but if it's bound to 192.168.0.8
> nothing comes in. I did a packet sniff, and indeed packets were being
> sent out to 255.255.255.255 via another machine on the network. I
> wrote a quick test program that would bind a socket to the lan ip and
> wait for incoming data. I tested it on a windows machine and linux.
> The windows machine could pick up packets fine, my linux machine could
> not. Is this proper behavior? It's fudging up several games and
> things in the wine project.
>
> Does anyone else experience this? Thanks!
It seems you are expecting too much of SO_BROADCAST option.
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html
SO_BROADCAST :
Non-zero requests permission to transmit broadcast datagrams (SOCK_DGRAM sockets only).
Note this only handles the transmission of packets, not receiving them.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip
2007-05-02 9:55 Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip Dylan Taft
2007-05-02 10:14 ` Eric Dumazet
@ 2007-05-02 10:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-05-02 10:30 UTC (permalink / raw)
To: d13f00l; +Cc: linux-kernel
SO_BROADCAST controls sending, not receiving.
This definition comes from the BSD sockets API, even
Stevens TCP/IP Illustrated Volume 2, page 437, figure
15.4 clearly states that SO_BROADCAST means "socket
can send broadcast messages". It says nothing about
receiving and the BSD implementation matches that
description, as does Linux.
This has been brought up before, search for the
subject "UDP Broadcasts not delivered to IP address"
in the linux-net list archives for one such thread.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-02 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-02 9:55 Strange UDP Issue on 2.6.20.8 - broadcasts not being received if socket bound to local ip Dylan Taft
2007-05-02 10:14 ` Eric Dumazet
2007-05-02 10:30 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®