From: Alan T. DeKok Date: Wed, 24 Jan 2024 14:11:36 +0000 (-0500) Subject: move to run-time error instead of build error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc7d79729af13964ac61293186013b6e65a0f5d;p=thirdparty%2Ffreeradius-server.git move to run-time error instead of build error FreeBSD has IP_RECVIF, not SO_BINDTODEVICE. And IP_RECVIF only works for datagram sockets, and has to be used with recvmsg() So until we get that code working, just disallow binding to an interface. --- diff --git a/src/lib/bio/fd_open.c b/src/lib/bio/fd_open.c index 246a9fa4455..366fee7d815 100644 --- a/src/lib/bio/fd_open.c +++ b/src/lib/bio/fd_open.c @@ -628,19 +628,19 @@ static int fr_bio_fd_socket_bind_to_device(fr_bio_fd_t *my, UNUSED fr_bio_fd_con } #else -#error This system is missing SO_BINDTODEVICE, IP_BOUND_IF, IPV6_BOUND_IF - -/** ??? Who knows? +/** This system is missing SO_BINDTODEVICE, IP_BOUND_IF, IPV6_BOUND_IF + * + * @todo - FreeBSD IP_RECVIF and IP_SENDIF + * + * Except that has to be done in recvmsg() and sendmsg(). And it only works on datagram sockets. * + * cmsg_len = sizeof(struct sockaddr_dl) + * cmsg_level = IPPROTO_IP + * cmsg_type = IP_RECVIF */ static int fr_bio_fd_socket_bind_to_device(fr_bio_fd_t *my, fr_bio_fd_config_t const *cfg) { - /* - * @todo - see fr_socket_bind(). Troll through the interfaces to see which interface has a name - * which matches the named interface. If so, copy over it's IP to our src_ip, so long as src_ip - * is INADDR_ANY. - */ - + fr_sterror_const("Bind to interface is not supported on this platform"); return -1; }