Skip to content

Commit ec6188b

Browse files
Vudentzjukkar
authored andcommitted
net: bt: Call net_if_carrier_down when disconnected
If IPSP channel is disconnected call net_if_carrier_down instead of net_if_down since the later may still attempt to send packets while the former just discard them immediatelly. Fixes #5317 Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 656bab0 commit ec6188b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/ip/l2/bluetooth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <bluetooth/uuid.h>
3333
#include <bluetooth/l2cap.h>
3434

35+
#include "net_private.h"
3536
#include "ipv6.h"
3637

3738
#define L2CAP_IPSP_PSM 0x0023
@@ -163,7 +164,7 @@ static void ipsp_disconnected(struct bt_l2cap_chan *chan)
163164
NET_DBG("Channel %p disconnected", chan);
164165

165166
/* Set iface down */
166-
net_if_down(ctxt->iface);
167+
net_if_carrier_down(ctxt->iface);
167168

168169
#if defined(CONFIG_NET_L2_BT_MGMT)
169170
if (chan->conn != default_conn) {

0 commit comments

Comments
 (0)