include $(TOPDIR)/rules.mk
PKG_NAME:=bluez
-PKG_VERSION:=5.49
-PKG_RELEASE:=2
+PKG_VERSION:=5.50
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
-PKG_HASH:=33301d7a514c73d535ee1f91c2aed1af1f2e53efe11d3ac06bcf0d7abed2ce95
+PKG_HASH:=5ffcaae18bbb6155f1591be8c24898dc12f062075a40b538b745bfd477481911
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bluetooth.conf $(1)/etc/dbus-1/system.d/bluetooth.conf
$(INSTALL_DIR) $(1)/etc/bluetooth
+++ /dev/null
-config bluetoothd
-# option config /etc/bluetooth/main.conf
- option enabled 1
-
-config hciattach
- option initspeed 115200
- option tty ttyS1
- option type csr
- option speed 115200
- option flow noflow
- option enabled 0
-
-config rfcomm
-# option config /etc/bluetooth/rfcomm.conf
- option enabled 0
---- a/Makefile.in 2017-09-14 11:47:06.000000000 +0200
-+++ b/Makefile.in 2017-09-15 02:52:39.315926972 +0200
-@@ -2472,7 +2472,7 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -2547,7 +2547,7 @@ unit_tests = $(am__append_52) unit/test-
@CLIENT_TRUE@ client/gatt.h client/gatt.c
@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
@MESH_TRUE@mesh_meshctl_SOURCES = mesh/main.c \
@MESH_TRUE@ mesh/mesh-net.h \
-@@ -2491,7 +2491,7 @@
+@@ -2566,7 +2566,7 @@ unit_tests = $(am__append_52) unit/test-
@MESH_TRUE@mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
@MESH_TRUE@ lib/libbluetooth-internal.la \
@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
@MONITOR_TRUE@ monitor/display.h monitor/display.c \
-@@ -2747,7 +2747,7 @@
+@@ -2827,7 +2827,7 @@ unit_tests = $(am__append_52) unit/test-
@READLINE_TRUE@ tools/obex-client-tool.c
@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
@READLINE_TRUE@ tools/obex-server-tool.c
-@@ -2756,15 +2756,15 @@
+@@ -2836,15 +2836,15 @@ unit_tests = $(am__append_52) unit/test-
@READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c
@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
@READLINE_TRUE@ src/libshared-glib.la \
@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \
@DEPRECATED_TRUE@@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \
-@@ -2773,7 +2773,7 @@
+@@ -2853,7 +2853,7 @@ unit_tests = $(am__append_52) unit/test-
@DEPRECATED_TRUE@@READLINE_TRUE@ client/display.h
@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
---- a/src/shared/util.h.old 2016-09-26 07:29:00.000000000 -0500
-+++ b/src/shared/util.h 2017-12-27 22:49:50.538716424 -0600
+--- a/src/shared/util.h
++++ b/src/shared/util.h
@@ -26,6 +26,7 @@
#include <alloca.h>
#include <byteswap.h>
delete mode 100644 obexd/src/org.bluez.obex.service
create mode 100644 obexd/src/org.bluez.obex.service.in
-diff --git a/Makefile.obexd b/Makefile.obexd
-index 3760867..142e7c3 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
-@@ -2,12 +2,12 @@
+@@ -1,12 +1,12 @@
if SYSTEMD
systemduserunitdir = @SYSTEMD_USERUNITDIR@
systemduserunit_DATA = obexd/src/obex.service
-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
- obex_plugindir = $(libdir)/obex/plugins
+ if OBEX
-diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
-deleted file mode 100644
-index a538088..0000000
--- a/obexd/src/org.bluez.obex.service
+++ /dev/null
@@ -1,4 +0,0 @@
-Name=org.bluez.obex
-Exec=/bin/false
-SystemdService=dbus-org.bluez.obex.service
-diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
-new file mode 100644
-index 0000000..9c815f2
--- /dev/null
+++ b/obexd/src/org.bluez.obex.service.in
@@ -0,0 +1,4 @@
+Name=org.bluez.obex
+Exec=@libexecdir@/obexd
+SystemdService=dbus-org.bluez.obex.service
---
-1.8.3.1
-
-
-diff --git a/src/bluetooth.conf b/src/bluetooth.conf
-index 0c0b221..013cf97 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -26,10 +26,10 @@
--- /dev/null
+From 2c3bba7b38be03834162e34069156f1fd49f0528 Mon Sep 17 00:00:00 2001
+From: "antoine.belvire@laposte.net" <antoine.belvire@laposte.net>
+Date: Tue, 27 Mar 2018 20:30:26 +0200
+Subject: adapter: Don't refresh adv_manager for non-LE devices
+
+btd_adv_manager_refresh is called upon MGMT_SETTING_DISCOVERABLE setting change
+but as only LE adapters have an adv_manager, this leads to segmentation fault
+for non-LE devices:
+
+0 btd_adv_manager_refresh (manager=0x0) at src/advertising.c:1176
+1 0x0000556fe45fcb02 in settings_changed (settings=<optimized out>,
+ adapter=0x556fe53f7c70) at src/adapter.c:543
+2 new_settings_callback (index=<optimized out>, length=<optimized out>,
+ param=<optimized out>, user_data=0x556fe53f7c70) at src/adapter.c:573
+3 0x0000556fe462c278 in request_complete (mgmt=mgmt@entry=0x556fe53f20c0,
+ status=<optimized out>, opcode=opcode@entry=7, index=index@entry=0,
+ length=length@entry=4, param=0x556fe53eb5f9) at src/shared/mgmt.c:261
+4 0x0000556fe462cd9d in can_read_data (io=<optimized out>,
+ user_data=0x556fe53f20c0) at src/shared/mgmt.c:353
+5 0x0000556fe46396e3 in watch_callback (channel=<optimized out>,
+ cond=<optimized out>, user_data=<optimized out>)
+ at src/shared/io-glib.c:170
+6 0x00007fe351c980e5 in g_main_context_dispatch ()
+ from /usr/lib64/libglib-2.0.so.0
+7 0x00007fe351c984b0 in ?? () from /usr/lib64/libglib-2.0.so.0
+8 0x00007fe351c987c2 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
+9 0x0000556fe45abc75 in main (argc=<optimized out>, argv=<optimized out>)
+ at src/main.c:770
+
+This commit prevents the call to btd_adv_manager_refresh for non-LE devices.
+---
+ src/adapter.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/src/adapter.c
++++ b/src/adapter.c
+@@ -540,7 +540,8 @@ static void settings_changed(struct btd_
+ g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ ADAPTER_INTERFACE, "Discoverable");
+ store_adapter_info(adapter);
+- btd_adv_manager_refresh(adapter->adv_manager);
++ if (adapter->supported_settings & MGMT_SETTING_LE)
++ btd_adv_manager_refresh(adapter->adv_manager);
+ }
+
+ if (changed_mask & MGMT_SETTING_BONDABLE) {