mirror of
https://xff.cz/git/u-boot/
synced 2025-09-06 19:22:11 +02:00
TFTP: rename STATE_RRQ to STATE_SEND_RRQ
With the upcoming TFTP server implementation, requests can be either outgoing or incoming, so avoid ambiguities. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
This commit is contained in:
committed by
Wolfgang Denk
parent
20478ceaa2
commit
e3fb0abe2b
12
net/tftp.c
12
net/tftp.c
@@ -80,7 +80,7 @@ static int TftpTsize;
|
|||||||
static short TftpNumchars;
|
static short TftpNumchars;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STATE_RRQ 1
|
#define STATE_SEND_RRQ 1
|
||||||
#define STATE_DATA 2
|
#define STATE_DATA 2
|
||||||
#define STATE_TOO_LARGE 3
|
#define STATE_TOO_LARGE 3
|
||||||
#define STATE_BAD_MAGIC 4
|
#define STATE_BAD_MAGIC 4
|
||||||
@@ -215,7 +215,7 @@ TftpSend(void)
|
|||||||
|
|
||||||
switch (TftpState) {
|
switch (TftpState) {
|
||||||
|
|
||||||
case STATE_RRQ:
|
case STATE_SEND_RRQ:
|
||||||
xp = pkt;
|
xp = pkt;
|
||||||
s = (ushort *)pkt;
|
s = (ushort *)pkt;
|
||||||
*s++ = htons(TFTP_RRQ);
|
*s++ = htons(TFTP_RRQ);
|
||||||
@@ -309,7 +309,7 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TftpState != STATE_RRQ && src != TftpRemotePort)
|
if (TftpState != STATE_SEND_RRQ && src != TftpRemotePort)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (len < 2)
|
if (len < 2)
|
||||||
@@ -399,10 +399,10 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|||||||
puts("\n\t ");
|
puts("\n\t ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TftpState == STATE_RRQ)
|
if (TftpState == STATE_SEND_RRQ)
|
||||||
debug("Server did not acknowledge timeout option!\n");
|
debug("Server did not acknowledge timeout option!\n");
|
||||||
|
|
||||||
if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
|
if (TftpState == STATE_SEND_RRQ || TftpState == STATE_OACK) {
|
||||||
/* first block received */
|
/* first block received */
|
||||||
TftpState = STATE_DATA;
|
TftpState = STATE_DATA;
|
||||||
TftpRemotePort = src;
|
TftpRemotePort = src;
|
||||||
@@ -632,7 +632,7 @@ TftpStart(void)
|
|||||||
|
|
||||||
TftpRemotePort = WELL_KNOWN_PORT;
|
TftpRemotePort = WELL_KNOWN_PORT;
|
||||||
TftpTimeoutCount = 0;
|
TftpTimeoutCount = 0;
|
||||||
TftpState = STATE_RRQ;
|
TftpState = STATE_SEND_RRQ;
|
||||||
/* Use a pseudo-random port unless a specific port is set */
|
/* Use a pseudo-random port unless a specific port is set */
|
||||||
TftpOurPort = 1024 + (get_timer(0) % 3072);
|
TftpOurPort = 1024 + (get_timer(0) % 3072);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user