Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/smc: no peer ID in CLC decline for SMCD

Just SMCR requires a CLC Peer ID, but not SMCD. The field should be
zero for SMCD.

Fixes: c758dfddc1b5 ("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>

authored by

Ursula Braun and committed by
David S. Miller
369537c9 67f562e3

+3 -1
+3 -1
net/smc/smc_clc.c
··· 372 372 dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline)); 373 373 dclc.hdr.version = SMC_CLC_V1; 374 374 dclc.hdr.flag = (peer_diag_info == SMC_CLC_DECL_SYNCERR) ? 1 : 0; 375 - memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid)); 375 + if (smc->conn.lgr && !smc->conn.lgr->is_smcd) 376 + memcpy(dclc.id_for_peer, local_systemid, 377 + sizeof(local_systemid)); 376 378 dclc.peer_diagnosis = htonl(peer_diag_info); 377 379 memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER)); 378 380