Commit 8b2f0f44 authored by Guvenc Gulce's avatar Guvenc Gulce Committed by Jakub Kicinski

net/smc: Use active link of the connection

Use active link of the connection directly and not
via linkgroup array structure when obtaining link
data of the connection.
Signed-off-by: default avatarGuvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8cf3f3e4
...@@ -160,17 +160,17 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb, ...@@ -160,17 +160,17 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
!list_empty(&smc->conn.lgr->list)) { !list_empty(&smc->conn.lgr->list)) {
struct smc_diag_lgrinfo linfo = { struct smc_diag_lgrinfo linfo = {
.role = smc->conn.lgr->role, .role = smc->conn.lgr->role,
.lnk[0].ibport = smc->conn.lgr->lnk[0].ibport, .lnk[0].ibport = smc->conn.lnk->ibport,
.lnk[0].link_id = smc->conn.lgr->lnk[0].link_id, .lnk[0].link_id = smc->conn.lnk->link_id,
}; };
memcpy(linfo.lnk[0].ibname, memcpy(linfo.lnk[0].ibname,
smc->conn.lgr->lnk[0].smcibdev->ibdev->name, smc->conn.lgr->lnk[0].smcibdev->ibdev->name,
sizeof(smc->conn.lgr->lnk[0].smcibdev->ibdev->name)); sizeof(smc->conn.lnk->smcibdev->ibdev->name));
smc_gid_be16_convert(linfo.lnk[0].gid, smc_gid_be16_convert(linfo.lnk[0].gid,
smc->conn.lgr->lnk[0].gid); smc->conn.lnk->gid);
smc_gid_be16_convert(linfo.lnk[0].peer_gid, smc_gid_be16_convert(linfo.lnk[0].peer_gid,
smc->conn.lgr->lnk[0].peer_gid); smc->conn.lnk->peer_gid);
if (nla_put(skb, SMC_DIAG_LGRINFO, sizeof(linfo), &linfo) < 0) if (nla_put(skb, SMC_DIAG_LGRINFO, sizeof(linfo), &linfo) < 0)
goto errout; goto errout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment