From: Samuel Ortiz Date: Mon, 15 Oct 2012 13:09:52 +0000 (+0200) Subject: NFC: Keep connection less bound sockets alive when DEP link goes down X-Git-Tag: v3.8-rc1~139^2~17^2~315^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8512be63bbf9216934ecd10e1f9e4f887076fc2;p=platform%2Fkernel%2Flinux-exynos.git 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 --- diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index ee01be1..7f92a85 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) } } + /* + * If we have a connection less socket bound, we keep it alive + * if the device is still present. + */ + if (sk->sk_state == LLCP_BOUND && sk->sk_type == SOCK_DGRAM && + listen == true) { + bh_unlock_sock(sk); + continue; + } + sk->sk_state = LLCP_CLOSED; bh_unlock_sock(sk);