net/smc: introduce link_idx for link group array
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 29 Apr 2020 15:10:39 +0000 (17:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Apr 2020 19:26:32 +0000 (12:26 -0700)
commit026c381fb4778d0d44af57b7ff674f31f04af221
tree0680bad4f4f97ff9d8b9379e105be11915b6cd2d
parentf3c1deddb21c19fb0eec3c61e80567ef4a79b58b
net/smc: introduce link_idx for link group array

The link_id is the index of the link in the array of the link group.
When a link in the array is reused for a new link, a different unique
link_id should be used, otherwise the index in the array could collide
with the previous link at this array position.
Use a new variable link_idx as array index, and make link_id an
increasing unique id value.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_core.c
net/smc/smc_core.h