aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2014-03-11 12:57:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-11 07:56:01 -0700
commit704361888958ec790aa2855e22df2d2d87a5d982 (patch)
treeb0978c0cf65e97918f6f51bea936283672454682
parente57a86a68ecd059478f087ac7453c6f9253fa887 (diff)
downloadopenembedded-core-contrib-704361888958ec790aa2855e22df2d2d87a5d982.tar.gz
openembedded-core-contrib-704361888958ec790aa2855e22df2d2d87a5d982.tar.bz2
openembedded-core-contrib-704361888958ec790aa2855e22df2d2d87a5d982.zip
avahi: handle SO_REUSEPORT not being available
Linux < 3.9 doesn't have the SO_REUSEPORT option so instead of failing to start when built with >=3.9 kernel headers but booted on <3.9 kernels, continue as if SO_REUSEPORT wasn't available. (From OE-Core rev: 85e89da55f778ad3713460cb0df1435d82e94510) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/avahi/avahi.inc1
-rw-r--r--meta/recipes-connectivity/avahi/files/reuseport-check.patch30
2 files changed, 31 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
index 7e4baecafe..9c9f540c5d 100644
--- a/meta/recipes-connectivity/avahi/avahi.inc
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -25,6 +25,7 @@ SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
file://avahi_fix_install_issue.patch \
file://fix_for_automake_1.12.x.patch \
file://out-of-tree.patch \
+ file://reuseport-check.patch \
"
USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
diff --git a/meta/recipes-connectivity/avahi/files/reuseport-check.patch b/meta/recipes-connectivity/avahi/files/reuseport-check.patch
new file mode 100644
index 0000000000..bb81c2cb4e
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/reuseport-check.patch
@@ -0,0 +1,30 @@
+Fix avahi-daemon when running on kernel < 3.9 (patch taken from Ubuntu).
+
+Upstream-Status: Pending (unmaintained upstream)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Description: SO_REUSEPORT may not exist in running kernel
+ When userspace defines SO_REUSEPORT we will attempt to enable socket
+ port number reuse. However if the running kernel does not support
+ this call it will fail preventing daemon startup. If this call is
+ present but fails ENOPROTOOPT then we know that actually the kernel
+ does not support it and we should continue as if we did not have the
+ call at all. (LP: #1228204)
+ .
+ This patch could be removed from the debian package after jessie release.
+Author: Andy Whitcroft <apw@canonical.com>
+
+Index: avahi-0.6.31/avahi-core/socket.c
+===================================================================
+--- avahi-0.6.31.orig/avahi-core/socket.c 2013-09-20 16:36:50.000000000 +0100
++++ avahi-0.6.31/avahi-core/socket.c 2013-09-20 16:38:23.781863644 +0100
+@@ -177,7 +177,8 @@
+ yes = 1;
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0) {
+ avahi_log_warn("SO_REUSEPORT failed: %s", strerror(errno));
+- return -1;
++ if (errno != ENOPROTOOPT)
++ return -1;
+ }
+ #endif
+