Skip to content

Commit

Permalink
NFC: Forbid SSAP binding to a not well known LLCP service
Browse files Browse the repository at this point in the history
With not Well Known Services there is no guarantees as to which
SSAP the server will be listening on, so there is no reason to
support binding to a specific source SAP.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jul 9, 2012
1 parent 8b7e8ed commit ebbb16d
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,24 +234,12 @@ u8 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local,

return LLCP_WKS_NUM_SAP + ssap;

} else if (sock->ssap != 0) {
if (sock->ssap < LLCP_WKS_NUM_SAP) {
if (!test_bit(sock->ssap, &local->local_wks)) {
set_bit(sock->ssap, &local->local_wks);
mutex_unlock(&local->sdp_lock);

return sock->ssap;
}

} else if (sock->ssap < LLCP_SDP_NUM_SAP) {
if (!test_bit(sock->ssap - LLCP_WKS_NUM_SAP,
&local->local_sdp)) {
set_bit(sock->ssap - LLCP_WKS_NUM_SAP,
&local->local_sdp);
mutex_unlock(&local->sdp_lock);
} else if (sock->ssap != 0 && sock->ssap < LLCP_WKS_NUM_SAP) {
if (!test_bit(sock->ssap, &local->local_wks)) {
set_bit(sock->ssap, &local->local_wks);
mutex_unlock(&local->sdp_lock);

return sock->ssap;
}
return sock->ssap;
}
}

Expand Down

0 comments on commit ebbb16d

Please sign in to comment.