Skip to content

Commit 627f169

Browse files
TaeheeYooPaolo Abeni
authored andcommitted
amt: add missing regeneration nonce logic in request logic
When AMT gateway starts sending a new request message, it should regenerate the nonce variable. Fixes: cbc21dc ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 928f353 commit 627f169

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/amt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,13 @@ static void amt_event_send_request(struct amt_dev *amt)
963963
amt->remote_ip = 0;
964964
amt_update_gw_status(amt, AMT_STATUS_INIT, false);
965965
amt->req_cnt = 0;
966+
amt->nonce = 0;
966967
goto out;
967968
}
968969

970+
if (!amt->req_cnt)
971+
get_random_bytes(&amt->nonce, sizeof(__be32));
972+
969973
amt_send_request(amt, false);
970974
amt_send_request(amt, true);
971975
amt_update_gw_status(amt, AMT_STATUS_SENT_REQUEST, true);

0 commit comments

Comments
 (0)