]> git.meshlink.io Git - catta/blobdiff - avahi-core/socket.c
* added a missing include in dbus-protocol.c
[catta] / avahi-core / socket.c
index ef7bca062d89d6b4927a90b361fabc36cf908f55..9be9ece24ab7d0a2b5d56be64f761a0f45cd926f 100644 (file)
@@ -171,6 +171,14 @@ static int bind_with_warn(int fd, const struct sockaddr *sa, socklen_t l) {
             return -1;
         }
 
+#ifdef SO_REUSEPORT
+        yes = 1;
+        if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0) {
+            avahi_log_warn("SO_REUSEPORT failed: %s", strerror(errno));
+            return -1;
+        }
+#endif
+
         if (bind(fd, sa, l) < 0) {
             avahi_log_warn("bind() failed: %s", strerror(errno));
             return -1;