--- libaitio/src/bpf.c 2013/06/25 16:42:41 1.1.2.12 +++ libaitio/src/bpf.c 2013/06/25 19:28:48 1.1.2.13 @@ -122,6 +122,17 @@ io_etherOpen(const char *csIface, int flags, int whdr, return -1; } + if (ioctl(eth, BIOCIMMEDIATE, &n) == -1) { + LOGERR; + close(eth); + return -1; + } + if (whdr && ioctl(eth, BIOCSHDRCMPLT, &n) == -1) { + LOGERR; + close(eth); + return -1; + } + if (!zcbuf) { if (ioctl(eth, BIOCGBLEN, &n) == -1) { LOGERR; @@ -162,17 +173,6 @@ io_etherOpen(const char *csIface, int flags, int whdr, if (buflen && *buflen) *buflen = n; #endif - } - - if (ioctl(eth, BIOCIMMEDIATE, &n) == -1) { - LOGERR; - close(eth); - return -1; - } - if (whdr && ioctl(eth, BIOCSHDRCMPLT, &n) == -1) { - LOGERR; - close(eth); - return -1; } if (csIface)