summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2022-08-30 09:38:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-08-31 08:31:21 +0200
commitcc6c1edd0100d4dd72d1780acb616556a56450a0 (patch)
tree3c9a7ba5f262fb1b003c75596d0113ff8464147c /fs
parent414945e29912b47e44a121239501f88569fa0e38 (diff)
downloadbarebox-cc6c1edd0100d4dd72d1780acb616556a56450a0.tar.gz
tftp: replace hardcoded blksize by global constant
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Link: https://lore.barebox.org/20220830073816.2694734-8-enrico.scholz@sigma-chemnitz.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/tftp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/tftp.c b/fs/tftp.c
index 0b2a420b66..264841f244 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -65,6 +65,7 @@
#define STATE_DONE 8
#define TFTP_BLOCK_SIZE 512 /* default TFTP block size */
+#define TFTP_MTU_SIZE 1432 /* MTU based block size */
#define TFTP_FIFO_SIZE 4096
#define TFTP_ERR_RESEND 1
@@ -133,12 +134,13 @@ static int tftp_send(struct file_priv *priv)
"timeout%c"
"%d%c"
"blksize%c"
- "1432",
+ "%u",
priv->filename + 1, '\0',
'\0', /* "octet" */
'\0', /* "timeout" */
TIMEOUT, '\0',
- '\0'); /* "blksize" */
+ '\0', /* "blksize" */
+ TFTP_MTU_SIZE);
pkt++;
if (!priv->push)