diff options
-rw-r--r-- | avahi-core/iface-pfroute.c | 3 | ||||
-rw-r--r-- | avahi-core/socket.c | 8 | ||||
-rw-r--r-- | avahi-daemon/dbus-protocol.c | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c index f1a1d47..f2401e9 100644 --- a/avahi-core/iface-pfroute.c +++ b/avahi-core/iface-pfroute.c @@ -230,15 +230,12 @@ static void socket_event(AvahiWatch *w, int fd, AvahiWatchEvent event,void *user assert(fd == nl->fd); do { - time_t now = time(NULL); if((bytes = recv(nl->fd, msg, 2048, MSG_DONTWAIT)) < 0) { if (errno == EAGAIN || errno == EINTR) return; avahi_log_error(__FILE__": recv() failed: %s", strerror(errno)); return; } - - avahi_log_debug("socket_event: got message of size %d on %s", (int)bytes, ctime(&now)); parse_rtmsg((struct rt_msghdr *)msg, bytes ,m); } while (bytes > 0); 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; diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index 965ffd5..d55becd 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -25,6 +25,7 @@ #include <string.h> #include <sys/ioctl.h> +#include <sys/socket.h> #include <netinet/in.h> #include <net/if.h> #include <errno.h> |