PERFORCE change 95815 for review
Warner Losh
imp at FreeBSD.org
Fri Apr 21 18:45:07 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=95815
Change 95815 by imp at imp_hammer on 2006/04/21 18:44:38
Save 64 bytes by storing the serverPort in network byte order,
rather than in host order and constantly swapping them...
Affected files ...
.. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#7 edit
Differences ...
==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#7 (text+ko) ====
@@ -148,7 +148,7 @@
udpHdr = (udp_header_t*)(ipHdr + 1);
udpHdr->src_port = SWAP16(localPort);
- udpHdr->dst_port = SWAP16(serverPort);
+ udpHdr->dst_port = serverPort;
udpHdr->udp_len = SWAP16(8 + tftpLength);
udpHdr->udp_cksum = 0;
@@ -332,12 +332,12 @@
if (ackBlock == -1) {
if (SWAP16(tftpHdr->block_num) != 1)
- break;
- serverPort = SWAP16(udpHdr->src_port);
- ackBlock = 0;
- }
+ break;
+ serverPort = udpHdr->src_port;
+ ackBlock = 0;
+ }
- if (serverPort != SWAP16(udpHdr->src_port))
+ if (serverPort != udpHdr->src_port)
break;
TFTP_ACK_Data(tftpHdr->data,
@@ -595,7 +595,7 @@
state = TFTP_WAITING_SERVER_MAC;
timeout = 10;
thisSeconds = GetSeconds();
- serverPort = 69;
+ serverPort = SWAP16(69);
++localPort;
ackBlock = -1;
More information about the p4-projects
mailing list