aboutsummaryrefslogtreecommitdiffstats
path: root/net/smc/smc_clc.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /net/smc/smc_clc.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/smc/smc_clc.c')
-rw-r--r--net/smc/smc_clc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index 3934913ab835..b7dd2743fb5c 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -95,9 +95,10 @@ int smc_clc_wait_msg(struct smc_sock *smc, void *buf, int buflen,
95 } 95 }
96 if (clcm->type == SMC_CLC_DECLINE) { 96 if (clcm->type == SMC_CLC_DECLINE) {
97 reason_code = SMC_CLC_DECL_REPLY; 97 reason_code = SMC_CLC_DECL_REPLY;
98 if (ntohl(((struct smc_clc_msg_decline *)buf)->peer_diagnosis) 98 if (((struct smc_clc_msg_decline *)buf)->hdr.flag) {
99 == SMC_CLC_DECL_SYNCERR)
100 smc->conn.lgr->sync_err = true; 99 smc->conn.lgr->sync_err = true;
100 smc_lgr_terminate(smc->conn.lgr);
101 }
101 } 102 }
102 103
103out: 104out:
@@ -105,8 +106,7 @@ out:
105} 106}
106 107
107/* send CLC DECLINE message across internal TCP socket */ 108/* send CLC DECLINE message across internal TCP socket */
108int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info, 109int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info)
109 u8 out_of_sync)
110{ 110{
111 struct smc_clc_msg_decline dclc; 111 struct smc_clc_msg_decline dclc;
112 struct msghdr msg; 112 struct msghdr msg;
@@ -118,7 +118,7 @@ int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info,
118 dclc.hdr.type = SMC_CLC_DECLINE; 118 dclc.hdr.type = SMC_CLC_DECLINE;
119 dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline)); 119 dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline));
120 dclc.hdr.version = SMC_CLC_V1; 120 dclc.hdr.version = SMC_CLC_V1;
121 dclc.hdr.flag = out_of_sync ? 1 : 0; 121 dclc.hdr.flag = (peer_diag_info == SMC_CLC_DECL_SYNCERR) ? 1 : 0;
122 memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid)); 122 memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid));
123 dclc.peer_diagnosis = htonl(peer_diag_info); 123 dclc.peer_diagnosis = htonl(peer_diag_info);
124 memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER)); 124 memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER));