From 3575e6dd5f5101e212fc3148de513ec1f10c3b85 Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Dorado Date: Thu, 7 Jun 2012 12:17:36 +0200 Subject: Allow sending to a broadcast address --- udprelay.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/udprelay.c b/udprelay.c index 672b6d1..aca49e8 100644 --- a/udprelay.c +++ b/udprelay.c @@ -133,6 +133,12 @@ int main(int argc, char *argv[]) { return 1; }; + /* Allow UDP broadcasts on sending socket */ + if (setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(int)) < 0) { + perror("setsockopt(sndfd, SOL_SOCKET, SO_BROADCAST, ...)"); + return 1; + } + /* Set properties of source address */ srcaddr.sin_family = AF_INET; srcaddr.sin_port = htons(lstport); -- cgit v1.2.3