--- ansh/src/utils.c 2011/10/13 14:29:30 1.1.1.1.2.6 +++ ansh/src/utils.c 2011/10/13 15:24:17 1.1.1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.1.1.1.2.6 2011/10/13 14:29:30 misho Exp $ + * $Id: utils.c,v 1.1.1.1.2.7 2011/10/13 15:24:17 misho Exp $ * *************************************************************************/ #include "global.h" @@ -60,6 +60,12 @@ PrepareL2(const char *psDev, int *bpflen) close(h); return -1; } + n = USHRT_MAX + 1; + if (ioctl(h, BIOCSBLEN, &n) == -1) { + printf("Error:: set buffer interface %s buffer length #%d - %s\n", psDev, errno, strerror(errno)); + close(h); + return -1; + } strlcpy(ifr.ifr_name, psDev, sizeof ifr.ifr_name); if (ioctl(h, BIOCSETIF, &ifr) == -1) { printf("Error:: bind interface %s to bpf #%d - %s\n", psDev, errno, strerror(errno)); @@ -72,7 +78,7 @@ PrepareL2(const char *psDev, int *bpflen) return -1; } if (ioctl(h, BIOCGBLEN, bpflen) == -1) { - printf("Error:: get interface %s buffer length #%d - %s\n", psDev, errno, strerror(errno)); + printf("Error:: get buffer interface %s buffer length #%d - %s\n", psDev, errno, strerror(errno)); close(h); return -1; }