aboutsummaryrefslogtreecommitdiff
path: root/network_io/unix/sockopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'network_io/unix/sockopt.c')
-rw-r--r--network_io/unix/sockopt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c
index 7b67c2ec13a1..6ce4b911efc0 100644
--- a/network_io/unix/sockopt.c
+++ b/network_io/unix/sockopt.c
@@ -141,6 +141,18 @@ apr_status_t apr_socket_opt_set(apr_socket_t *sock,
apr_set_option(sock, APR_SO_DEBUG, on);
}
break;
+ case APR_SO_BROADCAST:
+#ifdef SO_BROADCAST
+ if (on != apr_is_option_set(sock, APR_SO_BROADCAST)) {
+ if (setsockopt(sock->socketdes, SOL_SOCKET, SO_BROADCAST, (void *)&one, sizeof(int)) == -1) {
+ return errno;
+ }
+ apr_set_option(sock, APR_SO_BROADCAST, on);
+ }
+#else
+ return APR_ENOTIMPL;
+#endif
+ break;
case APR_SO_REUSEADDR:
if (on != apr_is_option_set(sock, APR_SO_REUSEADDR)) {
if (setsockopt(sock->socketdes, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) == -1) {