UDP Broadcasts Doesn't ?????

UDP Broadcasts Doesn't ?????

Post by Weng L » Fri, 23 Dec 1994 12:43:42

I have been trying for quite a while to port some
client server apps to Linux. The only real problem
is that I just can't get UDP broadcasts to work
properly on kernels 1.1.18 thru 1.1.59.

Here's the story: (example network: 199.99.99)

if route includes entry for to eth0, UDP broadcasts
( are sent to other machines on network,
but processes on local machine do not see broadcasts!

If this entry is replaced with to lo, UDP broadcasts
are now seen by processes on local machine, but other machines
on the net do not get them!!!

It seems that you can route broadcasts out on the net to other
processes or send them back to local processes but not do both!

Note that the app works correctly on Sun 4.1.3, SOLARIS 2.4,
HP-UX, DEC OSF, AIX and even Windows NT, but does not seem to
work under Linux :-(.

I have tried all kinds of contortions with the IP routing
tables including rebuilding the kernel without IP forwarding,
but nothing seems to fix this really doozy behaviour.

Any clues?



1. udp broadcast on more than one nic's

Hello all,

I would like to doing a UDP broadcast via port 3000. For linux boxes with one
interface card everything works as expected. But if the box has two or more
cards, these are
ignored and the broadcast is further send only via the first interface. My code
is attached at the end.

Do I need some special to go over all interfaces available on a linux box ?

Thanks in advance
Lars Gsmar

here is the code:

int    i = 1;
static DWORD   dwLocalAddr = 0;
static u_short PortStatus = 3000;
static int     UpSocket;
char   szBuffer[1024],
struct sockaddr_in addr;

#define StrUp "This is the broadcast message"

 addr.sin_port        = htons(PortStatus);
 addr.sin_family      = AF_INET;
 addr.sin_addr.s_addr = (DWORD) -1;

setsockopt(UpSocket, SOL_SOCKET, SO_BROADCAST, (LPSTR)&i,sizeof(i));
bind(UpSocket, &addr, sizeof(addr));

if (sendto(UpSocket, StrUp, sizeof(StrUp) + 1, 0, (LPSOCKADDR)&addr,
sizeof(addr)) == -1)
      Message("Broadcast failed!\n");

2. pci conflict/cdrom error

3. broadcast ping doesn't work

4. REQ: Homer's scream

5. PING: Linux doesn't respond to ARP broadcast

6. isdn with i4b!!! PROBLEMS

7. My linux box doesn't answer to broadcast

8. SAS gives vvm_sbrk errors under AIX 3.2

9. Broadcast ping doesn't work?

10. Shutdown doesn't support warning-message broadcast

11. : ISDN doesn't hang up, "udp port unreachable"

12. TCP works, UDP doesn't on a stand alone box

13. * [A] SLIP Question: UDP works but TCP doesn't (SLS 1.0.3)