socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 17 <snip> sendto(17, "\0\0\4\27'\20\31\200\0\0\0\0\5\277\216Z", 16, MSG_DONTWAIT|MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(6969), sin_addr=inet_addr("255.255.255.255")}, 16) = -1 EACCES (Permission denied)
EACCES (For UNIX domain sockets, which are identified by pathname) <snip> (For UDP sockets) An attempt was made to send to a network/broadcast address as though it was a unicast address.
SO_BROADCAST Set or get the broadcast flag. When enabled, datagram sockets are allowed to send packets to a broadcast address. This option has no effect on stream-oriented sockets.
int broadcast_flag = 1; setsockopt(udp_sock, SOL_SOCKET, SO_BROADCAST, &broadcast_flag, sizeof(broadcast_flag));