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 <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2018-02-19 10:39:48 +02:00 committed by Jukka Rissanen
parent 656bab0361
commit ec6188bc06

View file

@ -32,6 +32,7 @@
#include <bluetooth/uuid.h>
#include <bluetooth/l2cap.h>
#include "net_private.h"
#include "ipv6.h"
#define L2CAP_IPSP_PSM 0x0023
@ -163,7 +164,7 @@ static void ipsp_disconnected(struct bt_l2cap_chan *chan)
NET_DBG("Channel %p disconnected", chan);
/* Set iface down */
net_if_down(ctxt->iface);
net_if_carrier_down(ctxt->iface);
#if defined(CONFIG_NET_L2_BT_MGMT)
if (chan->conn != default_conn) {