--- libaitio/src/bpf.c 2013/06/26 15:04:02 1.1.2.17 +++ libaitio/src/bpf.c 2013/06/26 15:31:17 1.1.2.18 @@ -272,6 +272,11 @@ io_etherRecv(int eth, void * __restrict buf, size_t bu #ifdef __FreeBSD__ struct bpf_zbuf bz; struct bpf_zbuf_header *bzh; +#else + if (zcbuf) { + io_SetErr(ENOTSUP, "bpf zero copy buffer mode is not supported"); + return -1; + } #endif if (!buf || !buflen) { @@ -291,16 +296,9 @@ io_etherRecv(int eth, void * __restrict buf, size_t bu bzh = (struct bpf_zbuf_header*) zcache; memcpy(buf, zcache + sizeof(struct bpf_zbuf_header), MIN(buflen, rlen)); - ackZCbuf(bzh); } - if (!rlen && !ioctl(eth, BIOCROTZBUF, &bz)) { - bzh = (struct bpf_zbuf_header*) bz.bz_bufa; - if (bzh && chkZCbuf(bzh)) { - rlen = bz.bz_buflen; - memcpy(buf, bz.bz_bufa + sizeof(struct bpf_zbuf_header), - MIN(buflen, rlen)); - } - } + if (!rlen && !ioctl(eth, BIOCROTZBUF, &bz)) + continue; } while (0); #else rlen = -1;