diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index db83f92d274c..dafaee91cdfb 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1979,12 +1979,23 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt) | |||
1979 | list_for_each_safe(p, n, &s->dlcs) { | 1979 | list_for_each_safe(p, n, &s->dlcs) { |
1980 | d = list_entry(p, struct rfcomm_dlc, list); | 1980 | d = list_entry(p, struct rfcomm_dlc, list); |
1981 | 1981 | ||
1982 | if (!status && encrypt == 0x00 && | 1982 | if (test_and_clear_bit(RFCOMM_SEC_PENDING, &d->flags)) { |
1983 | d->sec_level == BT_SECURITY_HIGH && | 1983 | rfcomm_dlc_clear_timer(d); |
1984 | (d->state == BT_CONNECTED || | 1984 | if (status || encrypt == 0x00) { |
1985 | d->state == BT_CONFIG)) { | 1985 | __rfcomm_dlc_close(d, ECONNREFUSED); |
1986 | __rfcomm_dlc_close(d, ECONNREFUSED); | 1986 | continue; |
1987 | continue; | 1987 | } |
1988 | } | ||
1989 | |||
1990 | if (d->state == BT_CONNECTED && !status && encrypt == 0x00) { | ||
1991 | if (d->sec_level == BT_SECURITY_MEDIUM) { | ||
1992 | set_bit(RFCOMM_SEC_PENDING, &d->flags); | ||
1993 | rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); | ||
1994 | continue; | ||
1995 | } else if (d->sec_level == BT_SECURITY_HIGH) { | ||
1996 | __rfcomm_dlc_close(d, ECONNREFUSED); | ||
1997 | continue; | ||
1998 | } | ||
1988 | } | 1999 | } |
1989 | 2000 | ||
1990 | if (!test_and_clear_bit(RFCOMM_AUTH_PENDING, &d->flags)) | 2001 | if (!test_and_clear_bit(RFCOMM_AUTH_PENDING, &d->flags)) |