OSDN Git Service

net/smc: fix toleration of fake add_link messages
authorKarsten Graul <kgraul@linux.ibm.com>
Thu, 3 Sep 2020 19:53:15 +0000 (21:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Sep 2020 23:52:33 +0000 (16:52 -0700)
commitfffe83c8c40a61978f8998a85cc94bb2ca19b6dd
tree7aa63d579c048a3455ebc7ab54ff82b513db8f21
parent556699341efa98243e08e34401b3f601da91f5a3
net/smc: fix toleration of fake add_link messages

Older SMCR implementations had no link failover support and used one
link only. Because the handshake protocol requires to try the
establishment of a second link the old code sent a fake add_link message
and declined any server response afterwards.
The current code supports multiple links and inspects the received fake
add_link message more closely. To tolerate the fake add_link messages
smc_llc_is_local_add_link() needs an improved check of the message to
be able to separate between locally enqueued and fake add_link messages.
And smc_llc_cli_add_link() needs to check if the provided qp_mtu size is
invalid and reject the add_link request in that case.

Fixes: c48254fa48e5 ("net/smc: move add link processing for new device into llc layer")
Reviewed-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_llc.c