Backout commit 8f1bc284 as it causes TFTP to fail.

Signed-off-by: Wolfgang Denk <wd@denx.de>
master
Wolfgang Denk 17 years ago
parent 1900fbf255
commit ff13ac8c7b
  1. 20
      net/tftp.c

@ -238,9 +238,9 @@ TftpSend (void)
static void static void
TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len) TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
{ {
char * blksize;
ushort proto; ushort proto;
ushort *s; ushort *s;
int i;
if (dest != TftpOurPort) { if (dest != TftpOurPort) {
#ifdef CONFIG_MCAST_TFTP #ifdef CONFIG_MCAST_TFTP
@ -272,22 +272,22 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
case TFTP_OACK: case TFTP_OACK:
#ifdef ET_DEBUG #ifdef ET_DEBUG
printf("Got OACK:\n"); printf("Got OACK: %s %s\n", pkt, pkt+strlen(pkt)+1);
print_buffer (0, pkt, 1, len, 16);
#endif #endif
TftpState = STATE_OACK; TftpState = STATE_OACK;
TftpServerPort = src; TftpServerPort = src;
/* Check for 'blksize' option */ /* Check for 'blksize' option */
pkt[len] = 0; /* NULL terminate so string ops work */ for (i=0;i<len-8;i++) {
blksize = strstr((char*)pkt, "blksize"); if (strcmp ((char*)pkt+i,"blksize") == 0) {
if ((blksize) && (blksize + 8 < (char*)pkt + len)) { TftpBlkSize = (unsigned short)
TftpBlkSize = simple_strtoul(blksize + 8, NULL, 10); simple_strtoul((char*)pkt+i+8,NULL,10);
#ifdef ET_DEBUG #ifdef ET_DEBUG
printf("Blocksize ack: %d\n", TftpBlkSize); printf ("Blocksize ack: %s, %d\n",
(char*)pkt+i+8,TftpBlkSize);
#endif #endif
break;
}
} }
#ifdef CONFIG_MCAST_TFTP #ifdef CONFIG_MCAST_TFTP
parse_multicast_oack((char *)pkt,len-1); parse_multicast_oack((char *)pkt,len-1);
if ((Multicast) && (!MasterClient)) if ((Multicast) && (!MasterClient))

Loading…
Cancel
Save