aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-10-15 09:09:52 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-26 12:26:50 -0400
commitc8512be63bbf9216934ecd10e1f9e4f887076fc2 (patch)
tree6d5d9c31a733638641bd883480f80448636000d2 /net/nfc
parent54292d64e1b6cbe735852aaf59e56ef78dc15f82 (diff)
NFC: Keep connection less bound sockets alive when DEP link goes down
When DEP goes down, bound cl sockets can be kept alive as there is no reason to kill a connection less server socket because the LLCP link went down. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/llcp/llcp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index ee01be17e21f..7f92a857b319 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -85,6 +85,16 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
85 } 85 }
86 } 86 }
87 87
88 /*
89 * If we have a connection less socket bound, we keep it alive
90 * if the device is still present.
91 */
92 if (sk->sk_state == LLCP_BOUND && sk->sk_type == SOCK_DGRAM &&
93 listen == true) {
94 bh_unlock_sock(sk);
95 continue;
96 }
97
88 sk->sk_state = LLCP_CLOSED; 98 sk->sk_state = LLCP_CLOSED;
89 99
90 bh_unlock_sock(sk); 100 bh_unlock_sock(sk);