--- libaitio/src/bpf.c 2013/06/24 14:43:00 1.1.2.3 +++ libaitio/src/bpf.c 2013/06/24 14:45:37 1.1.2.4 @@ -95,7 +95,7 @@ allocZCbuf(u_int len) * return: -1 error or >-1 bpf handle */ int -io_etherOpen(const char *csIface, int flags, int whdr, u_int buflen, void **zcbuf) +io_etherOpen(const char *csIface, int flags, int whdr, u_int *buflen, void **zcbuf) { int n = 1, eth = -1; register int i; @@ -124,9 +124,9 @@ io_etherOpen(const char *csIface, int flags, int whdr, close(eth); return -1; } - if (buflen) { + if (buflen && *buflen) { if (!zcbuf) { - if (ioctl(eth, BIOCSBLEN, &buflen) == -1) { + if (ioctl(eth, BIOCSBLEN, buflen) == -1) { LOGERR; close(eth); return -1; @@ -144,7 +144,7 @@ io_etherOpen(const char *csIface, int flags, int whdr, close(eth); return -1; } - if (!(*zcbuf = allocZCbuf(MIN(n, buflen)))) { + if (!(*zcbuf = allocZCbuf(MIN(n, *buflen)))) { close(eth); return -1; }