Use the same byte order everyone else does.
[rsc] --rw-rw-r-- M 777458 glenda sys 5611 Dec 23 10:37 sys/src/cmd/ip/ping.c
/n/sourcesdump/2005/1223/plan9/sys/src/cmd/ip/ping.c:144,151 -
/n/sourcesdump/2005/1224/plan9/sys/src/cmd/ip/ping.c:144,150
}
r = malloc(sizeof *r);
if(r != nil){
- ip->seq[0] = seq;
- ip->seq[1] = seq>>8;
+ hnputs(ip->seq, seq);
r->seq = seq;
r->next = nil;
lock(&listlock);
/n/sourcesdump/2005/1223/plan9/sys/src/cmd/ip/ping.c:200,206 -
/n/sourcesdump/2005/1224/plan9/sys/src/cmd/ip/ping.c:199,205
munged++;
if(munged)
print("currupted reply\n");
- x = (ip->seq[1]<<8)|ip->seq[0];
+ x = nhgets(ip->seq);
if(ip->type != EchoReply || ip->code != 0) {
print("bad sequence/code/type %d/%d/%d\n",
ip->type, ip->code, x);
|