diff options
author | Ross Burton <ross.burton@intel.com> | 2014-02-18 12:13:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-20 14:28:10 +0000 |
commit | 66648268ab5803439aa282dd67982d520c491d56 (patch) | |
tree | ee2d0f2b74b9aa2c9b405e1a63c01de09f374ef3 /meta/recipes-connectivity/avahi | |
parent | 0bdf56fdcd15aa73b290742dd6e2b54b4af3196f (diff) | |
download | poky-66648268ab5803439aa282dd67982d520c491d56.tar.gz |
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>
Diffstat (limited to 'meta/recipes-connectivity/avahi')
-rw-r--r-- | meta/recipes-connectivity/avahi/avahi.inc | 1 | ||||
-rw-r--r-- | meta/recipes-connectivity/avahi/files/reuseport-check.patch | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc index 3a95b7fa1f..e4ff26a17c 100644 --- a/meta/recipes-connectivity/avahi/avahi.inc +++ b/meta/recipes-connectivity/avahi/avahi.inc | |||
@@ -26,6 +26,7 @@ SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \ | |||
26 | file://fix_for_automake_1.12.x.patch \ | 26 | file://fix_for_automake_1.12.x.patch \ |
27 | file://out-of-tree.patch \ | 27 | file://out-of-tree.patch \ |
28 | file://0001-avahi-fix-avahi-status-command-error-prompt.patch \ | 28 | file://0001-avahi-fix-avahi-status-command-error-prompt.patch \ |
29 | file://reuseport-check.patch \ | ||
29 | " | 30 | " |
30 | 31 | ||
31 | USERADD_PACKAGES = "avahi-daemon avahi-autoipd" | 32 | 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 @@ | |||
1 | Fix avahi-daemon when running on kernel < 3.9 (patch taken from Ubuntu). | ||
2 | |||
3 | Upstream-Status: Pending (unmaintained upstream) | ||
4 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
5 | |||
6 | Description: SO_REUSEPORT may not exist in running kernel | ||
7 | When userspace defines SO_REUSEPORT we will attempt to enable socket | ||
8 | port number reuse. However if the running kernel does not support | ||
9 | this call it will fail preventing daemon startup. If this call is | ||
10 | present but fails ENOPROTOOPT then we know that actually the kernel | ||
11 | does not support it and we should continue as if we did not have the | ||
12 | call at all. (LP: #1228204) | ||
13 | . | ||
14 | This patch could be removed from the debian package after jessie release. | ||
15 | Author: Andy Whitcroft <apw@canonical.com> | ||
16 | |||
17 | Index: avahi-0.6.31/avahi-core/socket.c | ||
18 | =================================================================== | ||
19 | --- avahi-0.6.31.orig/avahi-core/socket.c 2013-09-20 16:36:50.000000000 +0100 | ||
20 | +++ avahi-0.6.31/avahi-core/socket.c 2013-09-20 16:38:23.781863644 +0100 | ||
21 | @@ -177,7 +177,8 @@ | ||
22 | yes = 1; | ||
23 | if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0) { | ||
24 | avahi_log_warn("SO_REUSEPORT failed: %s", strerror(errno)); | ||
25 | - return -1; | ||
26 | + if (errno != ENOPROTOOPT) | ||
27 | + return -1; | ||
28 | } | ||
29 | #endif | ||
30 | |||