fastboot_handle_boot() takes a "success" flag and boots the downloaded
image, leaves fastboot or reboots only when it is set. The TCP transport
passes strncmp("OKAY", ...) != 0, which is true when the command failed:
since the TCP rework, "boot", "continue" and "reboot*" over TCP do nothing
after their OKAY reply and would act after a FAIL. Pass the comparison
result like the UDP transport does.
Fixes: bf962de97c37 ("net/tcp: improve tcp framework, use better state machine")
Signed-off-by: Igor Opaniuk <[email protected]>
---
net/fastboot_tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/fastboot_tcp.c b/net/fastboot_tcp.c
index 3ea25c997fc..b9b4f707b14 100644
--- a/net/fastboot_tcp.c
+++ b/net/fastboot_tcp.c
@@ -57,7 +57,7 @@ static void tcp_stream_on_rcv_nxt_update(struct tcp_stream
*tcp, u32 rx_bytes)
fastboot_command_id = fastboot_handle_command(rxbuf + sizeof(u64),
txbuf + sizeof(u64));
fastboot_handle_boot(fastboot_command_id,
- strncmp("OKAY", txbuf + sizeof(u64), 4) != 0);
+ strncmp("OKAY", txbuf + sizeof(u64), 4) == 0);
rxbuf[sizeof(u64) + cmd_size] = saved;
len = strlen(txbuf + sizeof(u64));
---
base-commit: ed869863c7e2aca50d57a05d843830dd843138c4
change-id: 20261022-upstream-fastboot_tcp_fix_b4-a3e7c91f0b62
Best regards,
--
Igor Opaniuk <[email protected]>