--- libaitrpc/src/srv.c 2012/03/29 00:40:59 1.7.2.3 +++ libaitrpc/src/srv.c 2012/03/29 01:23:59 1.7.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.7.2.3 2012/03/29 00:40:59 misho Exp $ +* $Id: srv.c,v 1.7.2.4 2012/03/29 01:23:59 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -87,7 +87,7 @@ txPacket(sched_task_t *task) /* calculate CRC */ rpc->call_crc ^= rpc->call_crc; - rpc->call_crc = htons(crcFletcher16((u_short*) buf, io_align(wlen, 1) / 2)); + rpc->call_crc = htons(crcFletcher16((u_short*) buf, wlen / 2)); /* send reply */ ret = send(TASK_FD(task), buf, wlen, 0); @@ -200,8 +200,7 @@ rxPacket(sched_task_t *task) /* check integrity of packet */ crc = ntohs(rpc->call_crc); rpc->call_crc ^= rpc->call_crc; - if (crc != crcFletcher16((u_short*) (buf + off), - io_align(ntohs(rpc->call_len), 1) / 2)) { + if (crc != crcFletcher16((u_short*) (buf + off), ntohs(rpc->call_len) / 2)) { rpc_SetErr(ERPCMISMATCH, "Bad CRC RPC packet"); off += ntohs(rpc->call_len); @@ -302,7 +301,7 @@ txBLOB(sched_task_t *task) /* calculate CRC */ blob->hdr_crc ^= blob->hdr_crc; - blob->hdr_crc = htons(crcFletcher16((u_short*) buf, io_align(wlen, 1) / 2)); + blob->hdr_crc = htons(crcFletcher16((u_short*) buf, wlen / 2)); /* send reply */ wlen = send(TASK_FD(task), buf, wlen, 0); @@ -364,7 +363,7 @@ rxBLOB(sched_task_t *task) /* check integrity of packet */ crc = ntohs(blob->hdr_crc); blob->hdr_crc ^= blob->hdr_crc; - if (crc != crcFletcher16((u_short*) buf, io_align(rlen, 1) / 2)) { + if (crc != crcFletcher16((u_short*) buf, rlen / 2)) { rpc_SetErr(ERPCMISMATCH, "Bad CRC BLOB packet"); schedRead(TASK_ROOT(task), rxBLOB, TASK_ARG(task), TASK_FD(task), TASK_DATA(task), TASK_DATLEN(task));