From 54292d64e1b6cbe735852aaf59e56ef78dc15f82 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 15 Oct 2012 15:08:29 +0200 Subject: [PATCH] NFC: Check for connection less sockets when looking for a service name Connection less server sockets will be in BOUND state, not LISTEN. Signed-off-by: Samuel Ortiz --- net/nfc/llcp/llcp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index dd2cc0e48a1d..ee01be17e21f 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c @@ -249,7 +249,12 @@ struct nfc_llcp_sock *nfc_llcp_sock_from_sn(struct nfc_llcp_local *local, pr_debug("llcp sock %p\n", tmp_sock); - if (tmp_sock->sk.sk_state != LLCP_LISTEN) + if (tmp_sock->sk.sk_type == SOCK_STREAM && + tmp_sock->sk.sk_state != LLCP_LISTEN) + continue; + + if (tmp_sock->sk.sk_type == SOCK_DGRAM && + tmp_sock->sk.sk_state != LLCP_BOUND) continue; if (tmp_sock->service_name == NULL || -- 2.20.1