Skip to content

Commit

Permalink
NFC: Keep connection less bound sockets alive when DEP link goes down
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed Oct 26, 2012
1 parent 54292d6 commit c8512be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c8512be

Please sign in to comment.