Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46c4c941 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

Bluetooth: Fix always checking the blacklist for incoming connections



We should check the blacklist no matter what, meaning also when we're
not connectable. This patch fixes the respective logic in the function
making the decision whether to accept a connection or not.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f99353cf
Loading
Loading
Loading
Loading
+11 −12
Original line number Diff line number Diff line
@@ -2129,19 +2129,18 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
		return;
	}

	if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags)) {
	if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr,
				   BDADDR_BREDR)) {
		hci_reject_conn(hdev, &ev->bdaddr);
		return;
	}
	} else {
		if (!hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,

	if (!test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
	    !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr,
				    BDADDR_BREDR)) {
		    hci_reject_conn(hdev, &ev->bdaddr);
		    return;
	}
	}

	/* Connection accepted */