amt: fix gateway mode stuck
authorTaehee Yoo <ap420073@gmail.com>
Thu, 19 May 2022 03:15:54 +0000 (03:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:25:57 +0000 (10:25 +0200)
commitabceb949930f8a456ea9a878eb386c2224d91f42
tree4d3aba5cb9e26d4111615d9223f94cbaeba96ba0
parente2b97c258e1cf33b0bd9418e7708e73b233d3f95
amt: fix gateway mode stuck

[ Upstream commit 937956ba404e70a765ca5aa39d3d7564d86a8872 ]

If a gateway can not receive any response to requests from a relay,
gateway resets status from SENT_REQUEST to INIT and variable about a
relay as well. And then it should start the full establish step
from sending a discovery message and receiving advertisement message.
But, after failure in amt_req_work() it continues sending a request
message step with flushed(invalid) relay information and sets SENT_REQUEST.
So, a gateway can't be established with a relay.
In order to avoid this situation, it stops sending the request message
step if it fails.

Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/amt.c