linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch BlueZ 0/1] Make network server interface handling more robust
@ 2016-09-18 16:35 Bobby Noelte
  2016-09-18 16:35 ` [Patch BlueZ 1/1] " Bobby Noelte
  0 siblings, 1 reply; 4+ messages in thread
From: Bobby Noelte @ 2016-09-18 16:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Bobby Noelte

Hi,

I encountered a lot problems connecting to a NAP server running on
Ubuntu 16.04 x86_64. Systemd-udev was renaming the bnepx interfaces
before network server could bring up the interface. Network server
went on to use the original interface name and failed on the creation
of the interface. This did not happen always but quite often.

The obvious solution was to prevent udev from renaming. But I could
not make that work. Also, IMHO, it is the task of bluetoothd to cope
with this situation because systemd-udev is now pretty common.

The choosen solution is to use the interface index where possible.
It does not change on rename. The kernel does not provide the ifindex
on BNEPCONNADD, but the interface name. So there is still a race
condition when retrieving the ifindex. Also there are race conditions
when using an interface name that was retrieved by interface index;
which is necessary for if up/down. To cope with these potential
races retry cycles are added.

The patched version of bluetoothd was tested using a SAMSUNG S2
(Android 4.1.2) and a NVIDIA Shield (Android 5.1.1). No connection
errors due to interface creation were realized so far. The
retries are necessary though.

The patch is 'minimal invasive'. Only the file bnep.c is changed.
Only static local function interfaces of bnep.c are changed/ added.
The patch also adds documentation to the static local functions
that are substantially changed or added. make check is passed.

Comments, suggestions appreciated.
Thanks,

Bobby

b0661n0e71e@gmail.com (1):
  Make network server interface handling more robust

 profiles/network/bnep.c | 311 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 260 insertions(+), 51 deletions(-)

--
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-19 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 16:35 [Patch BlueZ 0/1] Make network server interface handling more robust Bobby Noelte
2016-09-18 16:35 ` [Patch BlueZ 1/1] " Bobby Noelte
2016-09-19 12:16   ` Luiz Augusto von Dentz
2016-09-19 20:28     ` Bernhard Noelte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).