diff options
-rw-r--r-- | include/net/bluetooth/rfcomm.h | 1 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index d5eee2093b1e..e2e3ecad1008 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -211,6 +211,7 @@ struct rfcomm_dlc { | |||
211 | #define RFCOMM_AUTH_ACCEPT 6 | 211 | #define RFCOMM_AUTH_ACCEPT 6 |
212 | #define RFCOMM_AUTH_REJECT 7 | 212 | #define RFCOMM_AUTH_REJECT 7 |
213 | #define RFCOMM_DEFER_SETUP 8 | 213 | #define RFCOMM_DEFER_SETUP 8 |
214 | #define RFCOMM_ENC_DROP 9 | ||
214 | 215 | ||
215 | /* Scheduling flags and events */ | 216 | /* Scheduling flags and events */ |
216 | #define RFCOMM_SCHED_WAKEUP 31 | 217 | #define RFCOMM_SCHED_WAKEUP 31 |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 5ba3f6df665c..71ef2581c60f 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1802,6 +1802,11 @@ static inline void rfcomm_process_dlcs(struct rfcomm_session *s) | |||
1802 | continue; | 1802 | continue; |
1803 | } | 1803 | } |
1804 | 1804 | ||
1805 | if (test_bit(RFCOMM_ENC_DROP, &d->flags)) { | ||
1806 | __rfcomm_dlc_close(d, ECONNREFUSED); | ||
1807 | continue; | ||
1808 | } | ||
1809 | |||
1805 | if (test_and_clear_bit(RFCOMM_AUTH_ACCEPT, &d->flags)) { | 1810 | if (test_and_clear_bit(RFCOMM_AUTH_ACCEPT, &d->flags)) { |
1806 | rfcomm_dlc_clear_timer(d); | 1811 | rfcomm_dlc_clear_timer(d); |
1807 | if (d->out) { | 1812 | if (d->out) { |
@@ -2074,7 +2079,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) | |||
2074 | if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) { | 2079 | if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) { |
2075 | rfcomm_dlc_clear_timer(d); | 2080 | rfcomm_dlc_clear_timer(d); |
2076 | if (status || encrypt == 0x00) { | 2081 | if (status || encrypt == 0x00) { |
2077 | __rfcomm_dlc_close(d, ECONNREFUSED); | 2082 | set_bit(RFCOMM_ENC_DROP, &d->flags); |
2078 | continue; | 2083 | continue; |
2079 | } | 2084 | } |
2080 | } | 2085 | } |
@@ -2085,7 +2090,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) | |||
2085 | rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); | 2090 | rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); |
2086 | continue; | 2091 | continue; |
2087 | } else if (d->sec_level == BT_SECURITY_HIGH) { | 2092 | } else if (d->sec_level == BT_SECURITY_HIGH) { |
2088 | __rfcomm_dlc_close(d, ECONNREFUSED); | 2093 | set_bit(RFCOMM_ENC_DROP, &d->flags); |
2089 | continue; | 2094 | continue; |
2090 | } | 2095 | } |
2091 | } | 2096 | } |