0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-03 07:31:54 +00:00

Use IP_ONESBCAST at FreeBSD

IP_ONESBCAST allows send universal broadcast via requested interface
using directed broadcast.
This commit is contained in:
Pavel Tvrdik 2016-04-06 15:15:52 +02:00
parent 43ae8c395f
commit 6dc69a00f7

View File

@ -903,6 +903,11 @@ sk_setup_broadcast(sock *s)
if (setsockopt(s->fd, SOL_SOCKET, SO_BROADCAST, &y, sizeof(y)) < 0) if (setsockopt(s->fd, SOL_SOCKET, SO_BROADCAST, &y, sizeof(y)) < 0)
ERR("SO_BROADCAST"); ERR("SO_BROADCAST");
#ifdef __FreeBSD__
if (setsockopt(s->fd, IPPROTO_IP, IP_ONESBCAST, &y, sizeof(y)) < 0)
ERR("IP_ONESBCAST");
#endif
return 0; return 0;
} }