diff options
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index fb2e764c6211..d998ec360598 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -985,9 +985,10 @@ static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance) | |||
985 | /* Instance 0 always manages the "Tx Power" and "Flags" fields */ | 985 | /* Instance 0 always manages the "Tx Power" and "Flags" fields */ |
986 | flags = MGMT_ADV_FLAG_TX_POWER | MGMT_ADV_FLAG_MANAGED_FLAGS; | 986 | flags = MGMT_ADV_FLAG_TX_POWER | MGMT_ADV_FLAG_MANAGED_FLAGS; |
987 | 987 | ||
988 | /* For instance 0, assemble the flags from global settings */ | 988 | /* For instance 0, the HCI_ADVERTISING_CONNECTABLE setting corresponds |
989 | if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE) || | 989 | * to the "connectable" instance flag. |
990 | get_connectable(hdev)) | 990 | */ |
991 | if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE)) | ||
991 | flags |= MGMT_ADV_FLAG_CONNECTABLE; | 992 | flags |= MGMT_ADV_FLAG_CONNECTABLE; |
992 | 993 | ||
993 | return flags; | 994 | return flags; |
@@ -1242,7 +1243,12 @@ static void enable_advertising(struct hci_request *req) | |||
1242 | 1243 | ||
1243 | instance = get_current_adv_instance(hdev); | 1244 | instance = get_current_adv_instance(hdev); |
1244 | flags = get_adv_instance_flags(hdev, instance); | 1245 | flags = get_adv_instance_flags(hdev, instance); |
1245 | connectable = (flags & MGMT_ADV_FLAG_CONNECTABLE); | 1246 | |
1247 | /* If the "connectable" instance flag was not set, then choose between | ||
1248 | * ADV_IND and ADV_NONCONN_IND based on the global connectable setting. | ||
1249 | */ | ||
1250 | connectable = (flags & MGMT_ADV_FLAG_CONNECTABLE) || | ||
1251 | get_connectable(hdev); | ||
1246 | 1252 | ||
1247 | /* Set require_privacy to true only when non-connectable | 1253 | /* Set require_privacy to true only when non-connectable |
1248 | * advertising is used. In that case it is fine to use a | 1254 | * advertising is used. In that case it is fine to use a |