Skip to content

Commit

Permalink
NFC: Check for connection less sockets when looking for a service name
Browse files Browse the repository at this point in the history
Connection less server sockets will be in BOUND state, not LISTEN.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Oct 26, 2012
1 parent e690408 commit 54292d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 54292d6

Please sign in to comment.