summaryrefslogtreecommitdiffstats
path: root/avahi-core/socket.c
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2005-10-21 14:44:00 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2005-10-21 14:44:00 +0000
commit59395d1f90286156626bdb8df70752b7d169a9ce (patch)
tree4e64fec6bfd64779cb9f34ee6b8c1715444a2536 /avahi-core/socket.c
parent4e70b25df5a2ed6c11ff2df04b7f925e8d48bfbe (diff)
* added a missing include in dbus-protocol.c
* added REUSEPORT in socket.c * cosmetic cleaning in iface-pfroute.c git-svn-id: file:///home/lennart/svn/public/avahi/trunk@836 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/socket.c')
-rw-r--r--avahi-core/socket.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/avahi-core/socket.c b/avahi-core/socket.c
index ef7bca0..9be9ece 100644
--- a/avahi-core/socket.c
+++ b/avahi-core/socket.c
@@ -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;