From: Tolunay Orkun <listmember@orkun.us>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Patch: allow a fixed port for TFTP
Date: Mon, 10 Jan 2005 16:52:58 -0600 [thread overview]
Message-ID: <41E3074A.9040703@orkun.us> (raw)
In-Reply-To: <41E2B6B3.5050805@smiths-aerospace.com>
Jerry,
I have expressed my view that this patch does not address a real
problem. You mentioned that all these modifications were necessary
because the user were unable to configure their computer (lack of
necessary skills or lack of administrative access to configure Windows
firewall).
Nevertheless, if Wolfgang approves it, I would prefer changes to the
name of environment variable you are using. When referring to TCP/IP
services, we normally associate ports with the port the server component
is listening. Thus "tftpport" is not clear enough and may mislead people
to the server port. I would prefer more verbose "tftpclientport" or
"tftpsrcport". This would allow us to define "tftpserverport" or
"tftpdestport" later if necessary as well.
I do not object to CONFIG_TFTP_PORT, since same variable could be use to
enable configurable client and server ports if tftpserverport were to be
defined. In fact, I would include support for server port environment
support now since it would make your match more useful for a larger
audience IMHO.
Best regards,
Tolunay
Jerry Van Baren wrote:
> Hi Wolfgang, try two on the patch attached.
>
> * Patch by Jerry Van Baren 10 January 2005
> - Add a configuration option CONFIG_TFTP_PORT and optional env
> variable tftpport to force TFTP to use a fixed UDP port.
>
> gvb
>
>
> ------------------------------------------------------------------------
>
> Index: README
> ===================================================================
> RCS file: /cvsroot/u-boot/u-boot/README,v
> retrieving revision 1.117
> diff -p -u -r1.117 README
> --- README 9 Jan 2005 23:16:42 -0000 1.117
> +++ README 10 Jan 2005 04:13:50 -0000
> @@ -1480,6 +1480,22 @@ The following options need to be configu
> When SystemACE support is added, the "ace" device type
> becomes available to the fat commands, i.e. fatls.
>
> +- TFTP Fixed UDP Port:
> + CONFIG_TFTP_PORT
> +
> + If this is defined, the environment variable tftpport
> + is used to supply the TFTP UDP source port value.
> + If tftpport isn't defined, the normal pseudo-random port
> + number generator is used.
> +
> + The purpose for this 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.
> +
> - Show boot progress:
> CONFIG_SHOW_BOOT_PROGRESS
>
> @@ -2432,6 +2448,9 @@ Some configuration options can be set us
> Useful on scripts which control the retry operation
> themselves.
>
> + tftpport - If this is set, the value is used for TFTP's
> + UDP source port.
> +
> vlan - When set to a value < 4095 the traffic over
> ethernet is encapsulated/received over 802.1q
> VLAN tagged frames.
> Index: net/tftp.c
> ===================================================================
> RCS file: /cvsroot/u-boot/u-boot/net/tftp.c,v
> retrieving revision 1.9
> diff -p -u -r1.9 tftp.c
> --- net/tftp.c 15 Apr 2004 21:48:55 -0000 1.9
> +++ net/tftp.c 10 Jan 2005 04:13:51 -0000
> @@ -301,6 +301,10 @@ TftpTimeout (void)
> void
> TftpStart (void)
> {
> +#ifdef CONFIG_TFTP_PORT
> + char *ep; /* Environment pointer */
> +#endif
> +
> if (BootFile[0] == '\0') {
> IPaddr_t OurIP = ntohl(NetOurIP);
>
> @@ -354,7 +358,13 @@ TftpStart (void)
> TftpServerPort = WELL_KNOWN_PORT;
> TftpTimeoutCount = 0;
> TftpState = STATE_RRQ;
> + /* Use a pseudo-random port unless a specific port is set */
> TftpOurPort = 1024 + (get_timer(0) % 3072);
> +#ifdef CONFIG_TFTP_PORT
> + if ((ep = getenv("tftpport")) != NULL) {
> + TftpOurPort= simple_strtol(ep, NULL, 10);
> + }
> +#endif
> TftpBlock = 0;
>
> /* zero out server ether in case the server ip has changed */
next prev parent reply other threads:[~2005-01-10 22:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-10 17:09 [U-Boot-Users] Patch: allow a fixed port for TFTP Jerry Van Baren
2005-01-10 22:52 ` Tolunay Orkun [this message]
2005-01-11 15:08 ` Jerry Van Baren
2005-01-11 22:46 ` Wolfgang Denk
2005-09-24 20:38 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41E3074A.9040703@orkun.us \
--to=listmember@orkun.us \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox