--- libaitrpc/src/aitrpc.c 2015/01/15 20:39:11 1.16.2.1 +++ libaitrpc/src/aitrpc.c 2015/03/09 22:47:32 1.17.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitrpc.c,v 1.16.2.1 2015/01/15 20:39:11 misho Exp $ +* $Id: aitrpc.c,v 1.17.2.1 2015/03/09 22:47:32 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -188,6 +188,8 @@ rpc_Read(int sock, int type, int flags, sockaddr_t * _ } if (type == SOCK_STREAM) ret = recv(sock, buf, len, flags); + else if (type == SOCK_EXT) + ret = read(sock, buf, len); else if (type == SOCK_BPF && sa) { ret = read(sock, AIT_GET_BUF(&v), AIT_LEN(&v)); if (ret > 0) { @@ -258,6 +260,13 @@ rpc_Read(int sock, int type, int flags, sockaddr_t * _ } ret = blen - len; + if (type == SOCK_RAW && ret > 0) { + cx = sa->sa.sa_family == AF_INET ? + sizeof(struct ip) : sizeof(struct ip6_hdr); + memcpy(buf, buf + cx, ret - cx); + ret -= cx; + } + if (type == SOCK_BPF) AIT_FREE_VAL(&v); return ret; @@ -311,6 +320,8 @@ rpc_Write(int sock, int type, int flags, sockaddr_t * } if (type == SOCK_STREAM) ret = send(sock, buf, len, flags); + else if (type == SOCK_EXT) + ret = write(sock, buf, len); else if (type == SOCK_BPF && sa) { ret = write(sock, AIT_GET_BUF(&v), AIT_LEN(&v)); } else if (sa)