diff options
author | David S. Miller <davem@davemloft.net> | 2012-09-15 11:43:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-15 11:43:53 -0400 |
commit | b48b63a1f6e26b0dec2c9f1690396ed4bcb66903 (patch) | |
tree | 8d9ad227c3a7d35cd78d40ecaf9bf59375dbd21a /net/bluetooth | |
parent | 7f2e6a5d8608d0353b017a0fe15502307593734e (diff) | |
parent | 3f0c3c8fe30c725c1264fb6db8cc4b69db3a658a (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
net/netfilter/nfnetlink_log.c
net/netfilter/xt_LOG.c
Rather easy conflict resolution, the 'net' tree had bug fixes to make
sure we checked if a socket is a time-wait one or not and elide the
logging code if so.
Whereas on the 'net-next' side we are calculating the UID and GID from
the creds using different interfaces due to the user namespace changes
from Eric Biederman.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_conn.c | 4 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 11 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 2 | ||||
-rw-r--r-- | net/bluetooth/smp.c | 10 |
4 files changed, 16 insertions, 11 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 5ad7da217474..3c094e78dde9 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/bluetooth/bluetooth.h> | 29 | #include <net/bluetooth/bluetooth.h> |
30 | #include <net/bluetooth/hci_core.h> | 30 | #include <net/bluetooth/hci_core.h> |
31 | #include <net/bluetooth/a2mp.h> | 31 | #include <net/bluetooth/a2mp.h> |
32 | #include <net/bluetooth/smp.h> | ||
32 | 33 | ||
33 | static void hci_le_connect(struct hci_conn *conn) | 34 | static void hci_le_connect(struct hci_conn *conn) |
34 | { | 35 | { |
@@ -619,6 +620,9 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
619 | { | 620 | { |
620 | BT_DBG("hcon %p", conn); | 621 | BT_DBG("hcon %p", conn); |
621 | 622 | ||
623 | if (conn->type == LE_LINK) | ||
624 | return smp_conn_security(conn, sec_level); | ||
625 | |||
622 | /* For sdp we don't need the link key. */ | 626 | /* For sdp we don't need the link key. */ |
623 | if (sec_level == BT_SECURITY_SDP) | 627 | if (sec_level == BT_SECURITY_SDP) |
624 | return 1; | 628 | return 1; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index f0a3ab156ec6..e0abaf3cb6a5 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1216,14 +1216,15 @@ clean: | |||
1216 | static void l2cap_conn_ready(struct l2cap_conn *conn) | 1216 | static void l2cap_conn_ready(struct l2cap_conn *conn) |
1217 | { | 1217 | { |
1218 | struct l2cap_chan *chan; | 1218 | struct l2cap_chan *chan; |
1219 | struct hci_conn *hcon = conn->hcon; | ||
1219 | 1220 | ||
1220 | BT_DBG("conn %p", conn); | 1221 | BT_DBG("conn %p", conn); |
1221 | 1222 | ||
1222 | if (!conn->hcon->out && conn->hcon->type == LE_LINK) | 1223 | if (!hcon->out && hcon->type == LE_LINK) |
1223 | l2cap_le_conn_ready(conn); | 1224 | l2cap_le_conn_ready(conn); |
1224 | 1225 | ||
1225 | if (conn->hcon->out && conn->hcon->type == LE_LINK) | 1226 | if (hcon->out && hcon->type == LE_LINK) |
1226 | smp_conn_security(conn, conn->hcon->pending_sec_level); | 1227 | smp_conn_security(hcon, hcon->pending_sec_level); |
1227 | 1228 | ||
1228 | mutex_lock(&conn->chan_lock); | 1229 | mutex_lock(&conn->chan_lock); |
1229 | 1230 | ||
@@ -1236,8 +1237,8 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) | |||
1236 | continue; | 1237 | continue; |
1237 | } | 1238 | } |
1238 | 1239 | ||
1239 | if (conn->hcon->type == LE_LINK) { | 1240 | if (hcon->type == LE_LINK) { |
1240 | if (smp_conn_security(conn, chan->sec_level)) | 1241 | if (smp_conn_security(hcon, chan->sec_level)) |
1241 | l2cap_chan_ready(chan); | 1242 | l2cap_chan_ready(chan); |
1242 | 1243 | ||
1243 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { | 1244 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 3a6ce73541d9..083f2bf065d4 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -620,7 +620,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
620 | break; | 620 | break; |
621 | } | 621 | } |
622 | 622 | ||
623 | if (smp_conn_security(conn, sec.level)) | 623 | if (smp_conn_security(conn->hcon, sec.level)) |
624 | break; | 624 | break; |
625 | sk->sk_state = BT_CONFIG; | 625 | sk->sk_state = BT_CONFIG; |
626 | chan->state = BT_CONFIG; | 626 | chan->state = BT_CONFIG; |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 901a616c8083..8c225ef349cd 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -267,10 +267,10 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) | |||
267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, | 267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, |
268 | hcon->dst_type, reason); | 268 | hcon->dst_type, reason); |
269 | 269 | ||
270 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { | 270 | cancel_delayed_work_sync(&conn->security_timer); |
271 | cancel_delayed_work_sync(&conn->security_timer); | 271 | |
272 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) | ||
272 | smp_chan_destroy(conn); | 273 | smp_chan_destroy(conn); |
273 | } | ||
274 | } | 274 | } |
275 | 275 | ||
276 | #define JUST_WORKS 0x00 | 276 | #define JUST_WORKS 0x00 |
@@ -760,9 +760,9 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
760 | return 0; | 760 | return 0; |
761 | } | 761 | } |
762 | 762 | ||
763 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) | 763 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) |
764 | { | 764 | { |
765 | struct hci_conn *hcon = conn->hcon; | 765 | struct l2cap_conn *conn = hcon->l2cap_data; |
766 | struct smp_chan *smp = conn->smp_chan; | 766 | struct smp_chan *smp = conn->smp_chan; |
767 | __u8 authreq; | 767 | __u8 authreq; |
768 | 768 | ||