diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com> | 2015-03-09 17:24:47 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-03-12 11:08:00 +0100 |
commit | b104ec8263f1cf6ffad56ebb1edc8adb58a060aa (patch) | |
tree | aaa8c9d7496d721777d673f27faaed023ee5812c /android/pan.c | |
parent | 6f7dcbe7a7dd1c44c5a145e47ce0b685a9c8abeb (diff) | |
download | bluez-b104ec8263f1cf6ffad56ebb1edc8adb58a060aa.tar.gz |
profiles/network: Handle ctrl rsp after conn setup by bnep
This patch moves setup control response to bnep and makes it private.
Diffstat (limited to 'android/pan.c')
-rw-r--r-- | android/pan.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/android/pan.c b/android/pan.c index a1356eb9d..a14ed8452 100644 --- a/android/pan.c +++ b/android/pan.c @@ -463,7 +463,6 @@ static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond, { struct pan_device *dev = user_data; uint8_t packet[BNEP_MTU]; - uint16_t rsp = BNEP_CONN_NOT_ALLOWED; int sk, n, err; if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { @@ -486,22 +485,16 @@ static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond, } err = nap_create_bridge(); - if (err < 0) { + if (err < 0) error("pan: Failed to create bridge: %s (%d)", strerror(-err), -err); - goto failed; - } - if (bnep_server_add(sk, BNEP_BRIDGE, dev->iface, &dev->dst, packet, n) - < 0) { + if (bnep_server_add(sk, (err < 0) ? NULL : BNEP_BRIDGE, dev->iface, + &dev->dst, packet, n) < 0) { error("pan: server_connadd failed"); - rsp = BNEP_CONN_NOT_ALLOWED; goto failed; } - rsp = BNEP_SUCCESS; - bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_SETUP_CONN_RSP, rsp); - dev->watch = g_io_add_watch(chan, G_IO_HUP | G_IO_ERR | G_IO_NVAL, nap_watchdog_cb, dev); g_io_channel_unref(dev->io); @@ -513,7 +506,6 @@ static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond, return FALSE; failed: - bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_SETUP_CONN_RSP, rsp); pan_device_remove(dev); return FALSE; |