Don't compile support for Device=fd on platforms that do not support UNIX sockets.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 27 Jun 2021 13:31:49 +0000 (15:31 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 27 Jun 2021 13:31:49 +0000 (15:31 +0200)
src/fd_device.c
src/net_setup.c

index 8ac51fa..cfad5af 100644 (file)
@@ -20,6 +20,7 @@
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
 
 #include "system.h"
@@ -234,3 +235,4 @@ const devops_t fd_devops = {
        .read = read_packet,
        .write = write_packet,
 };
+#endif
index 7b4c741..1f0e74c 100644 (file)
@@ -1053,10 +1053,14 @@ static bool setup_myself(void) {
                        devops = raw_socket_devops;
                } else if(!strcasecmp(type, "multicast")) {
                        devops = multicast_devops;
-               } else if(!strcasecmp(type, "fd")) {
+               }
+
+#ifdef HAVE_SYS_UN_H
+               else if(!strcasecmp(type, "fd")) {
                        devops = fd_devops;
                }
 
+#endif
 #ifdef ENABLE_UML
                else if(!strcasecmp(type, "uml")) {
                        devops = uml_devops;