]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
NFC: llcp: Terminate connection when receiving a DISC on (0,0)
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 3 Apr 2013 14:44:44 +0000 (16:44 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 11 Apr 2013 14:29:09 +0000 (16:29 +0200)
According to the LLCP specs, we must terminate the LLCP link when receiving
a DISC with both ssap and dsap set to 0.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/llcp/llcp.c

index 3a161c87ef7814fcbaaebe08f3d53e84a7adaf9f..9e483c8e52f8d81d2319ef0e1832c88b9a38928c 100644 (file)
@@ -1106,6 +1106,12 @@ static void nfc_llcp_recv_disc(struct nfc_llcp_local *local,
        dsap = nfc_llcp_dsap(skb);
        ssap = nfc_llcp_ssap(skb);
 
+       if ((dsap == 0) && (ssap == 0)) {
+               pr_debug("Connection termination");
+               nfc_dep_link_down(local->dev);
+               return;
+       }
+
        llcp_sock = nfc_llcp_sock_get(local, dsap, ssap);
        if (llcp_sock == NULL) {
                nfc_llcp_send_dm(local, dsap, ssap, LLCP_DM_NOCONN);