diff options
author | Enrico Scholz <enrico.scholz@sigma-chemnitz.de> | 2022-08-30 09:38:03 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-31 08:31:21 +0200 |
commit | 3fdff746b02031fbd1cf90e419d0d7694802eb9e (patch) | |
tree | 6dc22cd5c70e21b64d13405faacafe355e70db5f | |
parent | cc6c1edd0100d4dd72d1780acb616556a56450a0 (diff) | |
download | barebox-3fdff746b02031fbd1cf90e419d0d7694802eb9e.tar.gz barebox-3fdff746b02031fbd1cf90e419d0d7694802eb9e.tar.xz |
tftp: remove sanity check of first block
With tftp window size support in the next patches, the first received
block might be !=1 (e.g. when it was reordered or dropped). There could
be checked whether it is in the first window, but the corresponding
sanity check can be dropped completely:
- OACK logic verifies that we speak with a tftp server (which always
sends block #1 as the first one). Diagnostic will help only with non
rfc 2743 servers (which are probably very rare resp. non existing
nowadays)
- the code some lines later handles this case already
Remove the check and simplify things.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Link: https://lore.barebox.org/20220830073816.2694734-9-enrico.scholz@sigma-chemnitz.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | fs/tftp.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -321,14 +321,6 @@ static void tftp_recv(struct file_priv *priv, priv->state = STATE_RDATA; priv->tftp_con->udp->uh_dport = uh_sport; priv->last_block = 0; - - if (priv->block != 1) { /* Assertion */ - pr_err("error: First block is not block 1 (%d)\n", - priv->block); - priv->err = -EINVAL; - priv->state = STATE_DONE; - break; - } } if (priv->block == priv->last_block) |