Skip to content

Commit f93de73

Browse files
Vudentzjhedberg
authored andcommitted
net: bt: Disconnect in case of errors sending a packet
Packets shall never fail to be sent now that they are queued, so if an error occured there is no point in keep the channel connected. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent cf84216 commit f93de73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subsys/net/l2/bluetooth/bluetooth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ static int net_bt_send(struct net_if *iface, struct net_pkt *pkt)
114114

115115
ret = bt_l2cap_chan_send(&conn->ipsp_chan.chan, buffer);
116116
if (ret < 0) {
117+
NET_ERR("Unable to send packet: %d", ret);
118+
bt_l2cap_chan_disconnect(&conn->ipsp_chan.chan);
117119
return ret;
118120
}
119121

0 commit comments

Comments
 (0)