[PATCH v4 17/21] tftp: do not use 'priv->block' for RRQ
Enrico Scholz
enrico.scholz at sigma-chemnitz.de
Tue Aug 30 00:38:12 PDT 2022
attribute is not used outside tftp_recv() for RRQ.
Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
---
fs/tftp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/tftp.c b/fs/tftp.c
index 88767223b052..c6c7a2e3c887 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -425,7 +425,7 @@ static void tftp_recv(struct file_priv *priv,
case TFTP_DATA:
len -= 2;
- priv->block = ntohs(*(uint16_t *)pkt);
+ block = ntohs(*(uint16_t *)pkt);
if (priv->state == STATE_RRQ) {
/* first block received; entered only with non rfc
@@ -440,11 +440,11 @@ static void tftp_recv(struct file_priv *priv,
break;
}
- if (priv->block != (uint16_t)(priv->last_block + 1))
+ if (block != (uint16_t)(priv->last_block + 1))
break;
tftp_timer_reset(priv);
- tftp_put_data(priv, priv->block, pkt + 2, len);
+ tftp_put_data(priv, block, pkt + 2, len);
break;
--
2.37.2
More information about the barebox
mailing list