Re: sending Broadcasts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Thomas Angst wrote:

> I try to send a broadcast UDP packet from a linux C program.
> I can send to every address where I want, but not to the broadcast address.
> What's wrong?

You need to use:

	int one = 1;
	setsockopt(sock_fd, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));

to enable broadcasts (they are disabled by default).

-- 
Glynn Clements <glynn@sensei.co.uk>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux