Skip to content
Snippets Groups Projects
Commit 087648b5 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Tom Rini
Browse files

net: tftp: sanitize tftp block size, especially for TX


U-Boot does not support IP fragmentation on TX (and unless
CONFIG_IP_DEFRAG is set, neither on RX). So the blocks we send must
fit in a single ethernet packet.

Currently, if tftpblocksize is set to something like 5000 and I
tftpput a large enough file, U-Boot crashes because we overflow
net_tx_packet (which only has room for 1500 bytes plus change).

Similarly, if tftpblocksize is set to something larger than what we
can actually receive (e.g. 50000, with NET_MAXDEFRAG being 16384), any
tftp get just hangs because we never receive any packets.

Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: default avatarRamon Fried <rfried.dev@gmail.com>
parent 4b8c44e3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment