diff options
author | Daniel Sanchez Dorado <dani@fib.upc.edu> | 2012-06-07 12:17:36 +0200 |
---|---|---|
committer | Luke Bratch <l_bratch@yahoo.co.uk> | 2014-10-01 02:57:58 +0200 |
commit | 3575e6dd5f5101e212fc3148de513ec1f10c3b85 (patch) | |
tree | 0433500c63f7acc518477f4955b27321e787475a | |
parent | b11e94b409a76062785c93502ce43bfff6147c94 (diff) |
Allow sending to a broadcast address
-rw-r--r-- | udprelay.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |