aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-05-01 14:14:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-01 14:14:05 -0400
commit076e7779c07c56c7fa593a28c71ea7432d0c7c95 (patch)
tree70a4227b5d898c1abf37ed5779b0cd6f29b471bc /net
parent116a0fc31c6c9b8fc821be5a96e5bf0b43260131 (diff)
parent66f2c99af3d6f2d0aa1120884cf1c60613ef61c0 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c27
-rw-r--r--net/bluetooth/hci_event.c3
-rw-r--r--net/bluetooth/mgmt.c2
-rw-r--r--net/mac80211/tx.c3
4 files changed, 19 insertions, 16 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 92a857e3786d..edfd61addcec 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1215,40 +1215,40 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)
1215 return NULL; 1215 return NULL;
1216} 1216}
1217 1217
1218static int hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn, 1218static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
1219 u8 key_type, u8 old_key_type) 1219 u8 key_type, u8 old_key_type)
1220{ 1220{
1221 /* Legacy key */ 1221 /* Legacy key */
1222 if (key_type < 0x03) 1222 if (key_type < 0x03)
1223 return 1; 1223 return true;
1224 1224
1225 /* Debug keys are insecure so don't store them persistently */ 1225 /* Debug keys are insecure so don't store them persistently */
1226 if (key_type == HCI_LK_DEBUG_COMBINATION) 1226 if (key_type == HCI_LK_DEBUG_COMBINATION)
1227 return 0; 1227 return false;
1228 1228
1229 /* Changed combination key and there's no previous one */ 1229 /* Changed combination key and there's no previous one */
1230 if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff) 1230 if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff)
1231 return 0; 1231 return false;
1232 1232
1233 /* Security mode 3 case */ 1233 /* Security mode 3 case */
1234 if (!conn) 1234 if (!conn)
1235 return 1; 1235 return true;
1236 1236
1237 /* Neither local nor remote side had no-bonding as requirement */ 1237 /* Neither local nor remote side had no-bonding as requirement */
1238 if (conn->auth_type > 0x01 && conn->remote_auth > 0x01) 1238 if (conn->auth_type > 0x01 && conn->remote_auth > 0x01)
1239 return 1; 1239 return true;
1240 1240
1241 /* Local side had dedicated bonding as requirement */ 1241 /* Local side had dedicated bonding as requirement */
1242 if (conn->auth_type == 0x02 || conn->auth_type == 0x03) 1242 if (conn->auth_type == 0x02 || conn->auth_type == 0x03)
1243 return 1; 1243 return true;
1244 1244
1245 /* Remote side had dedicated bonding as requirement */ 1245 /* Remote side had dedicated bonding as requirement */
1246 if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03) 1246 if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03)
1247 return 1; 1247 return true;
1248 1248
1249 /* If none of the above criteria match, then don't store the key 1249 /* If none of the above criteria match, then don't store the key
1250 * persistently */ 1250 * persistently */
1251 return 0; 1251 return false;
1252} 1252}
1253 1253
1254struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]) 1254struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8])
@@ -1285,7 +1285,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
1285 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len) 1285 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len)
1286{ 1286{
1287 struct link_key *key, *old_key; 1287 struct link_key *key, *old_key;
1288 u8 old_key_type, persistent; 1288 u8 old_key_type;
1289 bool persistent;
1289 1290
1290 old_key = hci_find_link_key(hdev, bdaddr); 1291 old_key = hci_find_link_key(hdev, bdaddr);
1291 if (old_key) { 1292 if (old_key) {
@@ -1328,10 +1329,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
1328 1329
1329 mgmt_new_link_key(hdev, key, persistent); 1330 mgmt_new_link_key(hdev, key, persistent);
1330 1331
1331 if (!persistent) { 1332 if (conn)
1332 list_del(&key->list); 1333 conn->flush_key = !persistent;
1333 kfree(key);
1334 }
1335 1334
1336 return 0; 1335 return 0;
1337} 1336}
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b37531094c49..6c065254afc0 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1901,6 +1901,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
1901 } 1901 }
1902 1902
1903 if (ev->status == 0) { 1903 if (ev->status == 0) {
1904 if (conn->type == ACL_LINK && conn->flush_key)
1905 hci_remove_link_key(hdev, &conn->dst);
1904 hci_proto_disconn_cfm(conn, ev->reason); 1906 hci_proto_disconn_cfm(conn, ev->reason);
1905 hci_conn_del(conn); 1907 hci_conn_del(conn);
1906 } 1908 }
@@ -2311,6 +2313,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
2311 2313
2312 case HCI_OP_USER_PASSKEY_NEG_REPLY: 2314 case HCI_OP_USER_PASSKEY_NEG_REPLY:
2313 hci_cc_user_passkey_neg_reply(hdev, skb); 2315 hci_cc_user_passkey_neg_reply(hdev, skb);
2316 break;
2314 2317
2315 case HCI_OP_LE_SET_SCAN_PARAM: 2318 case HCI_OP_LE_SET_SCAN_PARAM:
2316 hci_cc_le_set_scan_param(hdev, skb); 2319 hci_cc_le_set_scan_param(hdev, skb);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4ef275c69675..4bb03b111122 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2884,7 +2884,7 @@ int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status)
2884 return 0; 2884 return 0;
2885} 2885}
2886 2886
2887int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, u8 persistent) 2887int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, bool persistent)
2888{ 2888{
2889 struct mgmt_ev_new_link_key ev; 2889 struct mgmt_ev_new_link_key ev;
2890 2890
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 782a60198df4..e76facc69e95 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1158,7 +1158,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1158 tx->sta = rcu_dereference(sdata->u.vlan.sta); 1158 tx->sta = rcu_dereference(sdata->u.vlan.sta);
1159 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) 1159 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
1160 return TX_DROP; 1160 return TX_DROP;
1161 } else if (info->flags & IEEE80211_TX_CTL_INJECTED) { 1161 } else if (info->flags & IEEE80211_TX_CTL_INJECTED ||
1162 tx->sdata->control_port_protocol == tx->skb->protocol) {
1162 tx->sta = sta_info_get_bss(sdata, hdr->addr1); 1163 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
1163 } 1164 }
1164 if (!tx->sta) 1165 if (!tx->sta)