version 1.1.1.1.2.6, 2011/10/13 14:29:30
|
version 1.1.1.1.2.7, 2011/10/13 15:24:17
|
Line 60 PrepareL2(const char *psDev, int *bpflen)
|
Line 60 PrepareL2(const char *psDev, int *bpflen)
|
close(h); |
close(h); |
return -1; |
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); |
strlcpy(ifr.ifr_name, psDev, sizeof ifr.ifr_name); |
if (ioctl(h, BIOCSETIF, &ifr) == -1) { |
if (ioctl(h, BIOCSETIF, &ifr) == -1) { |
printf("Error:: bind interface %s to bpf #%d - %s\n", psDev, errno, strerror(errno)); |
printf("Error:: bind interface %s to bpf #%d - %s\n", psDev, errno, strerror(errno)); |
Line 72 PrepareL2(const char *psDev, int *bpflen)
|
Line 78 PrepareL2(const char *psDev, int *bpflen)
|
return -1; |
return -1; |
} |
} |
if (ioctl(h, BIOCGBLEN, bpflen) == -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); |
close(h); |
return -1; |
return -1; |
} |
} |