diff options
| author | Alvin Šipraga <[email protected]> | 2025-10-02 11:43:36 +0200 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2025-10-22 11:09:24 +0200 |
| commit | caa2ad6f8c8cc4c295c77aaff464c580d52c3ba6 (patch) | |
| tree | 4c95c8477bfb6444c260e5ec8fdd1a3fa143fb93 /net | |
| parent | 813a0df27a8af587bd25a6a4719f68066b370091 (diff) | |
tftp: make TFTP ports unconditionally configurable
A few lines of code being guarded by the CONFIG_TFTP_PORT option seems
an unnecessary restriction on the TFTP support provided by a vanilla
U-Boot image. In cases where the TFTP server cannot run as superuser -
and hence cannot run on the well-known port 69 - this quirk incurs a
full reconfiguration and rebuild of the bootloader only in order to
select the appropriate destination port.
Remove the CONFIG_TFTP_PORT option entirely and make the tftpdstp and
tftpsrcp variables always have an effect. Their being unset will mean
that U-Boot behaves the same as if CONFIG_TFTP_PORT was unset. Update
the documentation accordingly. And fix up the single board which was
originally enabling this option.
Signed-off-by: Alvin Šipraga <[email protected]>
Reviewed-by: Quentin Schulz <[email protected]>
Diffstat (limited to 'net')
| -rw-r--r-- | net/Kconfig | 18 | ||||
| -rw-r--r-- | net/tftp.c | 3 |
2 files changed, 1 insertions, 20 deletions
diff --git a/net/Kconfig b/net/Kconfig index 40ec6bbce76..7ba64d43b39 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -60,24 +60,6 @@ config SYS_FAULT_ECHO_LINK_DOWN this option is active, then CONFIG_SYS_FAULT_MII_ADDR also needs to be configured. -config TFTP_PORT - bool "Set TFTP UDP source/destination ports via the environment" - help - If this is defined, the environment variable tftpsrcp is used to - supply the TFTP UDP source port value. If tftpsrcp isn't defined, - the normal pseudo-random port number generator is used. - - Also, the environment variable tftpdstp is used to supply the TFTP - UDP destination port value. If tftpdstp isn't defined, the normal - port 69 is used. - - The purpose for tftpsrcp is to allow a TFTP server to blindly start - the TFTP transfer using the pre-configured target IP address and UDP - port. This has the effect of "punching through" the (Windows XP) - firewall, allowing the remainder of the TFTP transfer to proceed - normally. A better solution is to properly configure the firewall, - but sometimes that is not allowed. - config TFTP_WINDOWSIZE int "TFTP window size" default 1 diff --git a/net/tftp.c b/net/tftp.c index 1ca9a5ea7cf..1760877107f 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -926,14 +926,13 @@ void tftp_start(enum proto_t protocol) /* Use a pseudo-random port unless a specific port is set */ tftp_our_port = 1024 + (get_timer(0) % 3072); -#ifdef CONFIG_TFTP_PORT ep = env_get("tftpdstp"); if (ep != NULL) tftp_remote_port = simple_strtol(ep, NULL, 10); ep = env_get("tftpsrcp"); if (ep != NULL) tftp_our_port = simple_strtol(ep, NULL, 10); -#endif + tftp_cur_block = 0; tftp_windowsize = 1; tftp_last_nack = 0; |
