Date: Fri, 15 Sep 2006 22:20:52 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 106176 for review Message-ID: <200609152220.k8FMKqOY052691@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=106176 Change 106176 by imp@imp_lighthouse on 2006/09/15 22:20:09 Remove debug put back one (char *) that affected the generated code because the cast was from potiner to a udp packet to char *. Failure to cast adds 160 not 8! Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#34 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#34 (text+ko) ==== @@ -145,7 +145,7 @@ udpHdr->udp_len = SWAP16(8 + tftpLength); udpHdr->udp_cksum = 0; - memcpy(udpHdr+8, tftpData, tftpLength); + memcpy((char *)udpHdr+8, tftpData, tftpLength); t_checksum = IP_checksum((unsigned short*)ipHdr + 6, (16 + tftpLength)); @@ -209,7 +209,7 @@ dlAddress += len; lastSize += len; if (ackBlock % 128 == 0) - printf("tftp: %u kB", lastSize / 1024); + printf("tftp: %u kB\r", lastSize / 1024); } tftpHeader.opcode = TFTP_ACK_OPCODE; tftpHeader.block_num = SWAP16(ackBlock); @@ -259,7 +259,6 @@ case SWAP16(PROTOCOL_ARP): p_ARP = (arp_header_t*)pData; if (p_ARP->operation == SWAP16(ARP_REPLY)) { - printf("R"); // check if new server info is available if ((!serverMACSet) && (!(p_memcmp((char*)p_ARP->sender_ip, @@ -269,7 +268,6 @@ memcpy(serverMACAddr, p_ARP->sender_mac, 6); } } else if (p_ARP->operation == SWAP16(ARP_REQUEST)) { - printf("r"); // ARP REPLY operation p_ARP->operation = SWAP16(ARP_REPLY); @@ -297,7 +295,6 @@ } break; case SWAP16(PROTOCOL_IP): - printf("i"); pIpHeader = (ip_header_t*)(pData + 14); memcpy(pHeader, pIpHeader, sizeof(ip_header_t)); @@ -305,33 +302,24 @@ udp_header_t *udpHdr; tftp_header_t *tftpHdr; - printf("u"); udpHdr = (udp_header_t*)((char*)pIpHeader+20); tftpHdr = (tftp_header_t*)((char*)udpHdr + 8); - if (udpHdr->dst_port != localPort) { - printf("@ %x %x\n", udpHdr->dst_port, localPort); - break; - } + if (udpHdr->dst_port != localPort) + break; - if (tftpHdr->opcode != TFTP_DATA_OPCODE) { - printf("#"); - break; - } + if (tftpHdr->opcode != TFTP_DATA_OPCODE) + break; if (ackBlock == -1) { - if (tftpHdr->block_num != SWAP16(1)) { - printf("%"); - break; - } + if (tftpHdr->block_num != SWAP16(1)) + break; serverPort = udpHdr->src_port; ackBlock = 0; } - if (serverPort != udpHdr->src_port) { - printf("$"); - break; - } + if (serverPort != udpHdr->src_port) + break; TFTP_ACK_Data(tftpHdr->data, SWAP16(tftpHdr->block_num), @@ -552,11 +540,9 @@ if (CheckForNewPacket(&IpHeader)) { if (ackBlock == -2) break; - printf("P"); timeout = 10; thisSeconds = GetSeconds() + 1; } else if (GetSeconds() > thisSeconds) { - printf("."); --timeout; thisSeconds = GetSeconds() + 1; if (!serverMACSet)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609152220.k8FMKqOY052691>