]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/smc: no peer ID in CLC decline for SMCD
authorUrsula Braun <ubraun@linux.ibm.com>
Fri, 14 Feb 2020 07:59:00 +0000 (08:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Feb 2020 15:09:36 +0000 (07:09 -0800)
Just SMCR requires a CLC Peer ID, but not SMCD. The field should be
zero for SMCD.

Fixes: 2029a50d9566 ("net/smc: add SMC-D support in CLC messages")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_clc.c

index 0879f7bed96752c6832d1777a31ff633ae4b1aec..86cccc24e52e2d047c5617af4421902e8dd6c747 100644 (file)
@@ -372,7 +372,9 @@ int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info)
        dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline));
        dclc.hdr.version = SMC_CLC_V1;
        dclc.hdr.flag = (peer_diag_info == SMC_CLC_DECL_SYNCERR) ? 1 : 0;
-       memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid));
+       if (smc->conn.lgr && !smc->conn.lgr->is_smcd)
+               memcpy(dclc.id_for_peer, local_systemid,
+                      sizeof(local_systemid));
        dclc.peer_diagnosis = htonl(peer_diag_info);
        memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER));