--- libaitrpc/src/srv.c 2014/12/18 00:50:06 1.23.6.6 +++ libaitrpc/src/srv.c 2015/01/15 01:42:37 1.24 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: srv.c,v 1.23.6.6 2014/12/18 00:50:06 misho Exp $ +* $Id: srv.c,v 1.24 2015/01/15 01:42:37 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -729,7 +729,7 @@ rxBPFPacket(sched_task_t *task) rlen = read(TASK_FD(task), AIT_GET_BUF(&b), AIT_LEN(&b)); h = (struct bpf_hdr*) AIT_GET_BUF(&b); rlen -= h->bh_hdrlen; - if (rlen < h->bh_caplen || h->bh_caplen != h->bh_datalen || + if (rlen < h->bh_datalen || h->bh_caplen != h->bh_datalen || rlen < ETHER_HDR_LEN + sizeof(struct tagRPCCall)) { rpc_SetErr(ERPCMISMATCH, "Short RPC packet"); goto end; @@ -792,7 +792,7 @@ rxBPFPacket(sched_task_t *task) /* send RPC reply */ if (!noreply) - schedWrite(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], + schedEvent(TASK_ROOT(task), cbProto[srv->srv_proto][CB_TXPACKET], c, TASK_FD(task), rpc, len); end: AIT_FREE_VAL(&b);