Commit 28cb9375846b4f072f80536549713a6bc8fcf298
1 parent
ecb0ccd9c2
Exists in
master
and in
54 other branches
Update for TFTP using a fixed UDP port
Use the approved environment variable names. Added "tftpdstp" to allow ports other than 69 per Tolunay Orkun's recommendation. Patch by Jerry Van Baren, 12 Jan 2005
Showing 3 changed files with 20 additions and 5 deletions Side-by-side Diff
CHANGELOG
... | ... | @@ -2,6 +2,11 @@ |
2 | 2 | Changes for U-Boot 1.1.4: |
3 | 3 | ====================================================================== |
4 | 4 | |
5 | +* Update for TFTP using a fixed UDP port | |
6 | + Use the approved environment variable names. Added "tftpdstp" to | |
7 | + allow ports other than 69 per Tolunay Orkun's recommendation. | |
8 | + Patch by Jerry Van Baren, 12 Jan 2005 | |
9 | + | |
5 | 10 | * Allow to force TFTP to use a fixed UDP port |
6 | 11 | (Add a configuration option CONFIG_TFTP_PORT and optional env |
7 | 12 | variable tftpport) |
README
... | ... | @@ -1490,12 +1490,16 @@ |
1490 | 1490 | - TFTP Fixed UDP Port: |
1491 | 1491 | CONFIG_TFTP_PORT |
1492 | 1492 | |
1493 | - If this is defined, the environment variable tftpport | |
1493 | + If this is defined, the environment variable tftpsrcp | |
1494 | 1494 | is used to supply the TFTP UDP source port value. |
1495 | - If tftpport isn't defined, the normal pseudo-random port | |
1495 | + If tftpsrcp isn't defined, the normal pseudo-random port | |
1496 | 1496 | number generator is used. |
1497 | 1497 | |
1498 | - The purpose for this is to allow a TFTP server to | |
1498 | + Also, the environment variable tftpdstp is used to supply | |
1499 | + the TFTP UDP destination port value. If tftpdstp isn't | |
1500 | + defined, the normal port 69 is used. | |
1501 | + | |
1502 | + The purpose for tftpsrcp is to allow a TFTP server to | |
1499 | 1503 | blindly start the TFTP transfer using the pre-configured |
1500 | 1504 | target IP address and UDP port. This has the effect of |
1501 | 1505 | "punching through" the (Windows XP) firewall, allowing |
1502 | 1506 | |
... | ... | @@ -2468,8 +2472,11 @@ |
2468 | 2472 | Useful on scripts which control the retry operation |
2469 | 2473 | themselves. |
2470 | 2474 | |
2471 | - tftpport - If this is set, the value is used for TFTP's | |
2475 | + tftpsrcport - If this is set, the value is used for TFTP's | |
2472 | 2476 | UDP source port. |
2477 | + | |
2478 | + tftpdstport - If this is set, the value is used for TFTP's UDP | |
2479 | + destination port instead of the Well Know Port 69. | |
2473 | 2480 | |
2474 | 2481 | vlan - When set to a value < 4095 the traffic over |
2475 | 2482 | ethernet is encapsulated/received over 802.1q |
net/tftp.c
... | ... | @@ -371,7 +371,10 @@ |
371 | 371 | /* Use a pseudo-random port unless a specific port is set */ |
372 | 372 | TftpOurPort = 1024 + (get_timer(0) % 3072); |
373 | 373 | #ifdef CONFIG_TFTP_PORT |
374 | - if ((ep = getenv("tftpport")) != NULL) { | |
374 | + if ((ep = getenv("tftpdstp")) != NULL) { | |
375 | + TftpServerPort = simple_strtol(ep, NULL, 10); | |
376 | + } | |
377 | + if ((ep = getenv("tftpsrcp")) != NULL) { | |
375 | 378 | TftpOurPort= simple_strtol(ep, NULL, 10); |
376 | 379 | } |
377 | 380 | #endif |