ports/133772: libdnet can only use /dev/bpfX, where X > 32
Andrey Zaikin
zed.0xff at gmail.com
Thu Apr 16 08:40:03 UTC 2009
>Number: 133772
>Category: ports
>Synopsis: libdnet can only use /dev/bpfX, where X > 32
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Apr 16 08:40:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Andrey Zaikin
>Release: 7.1-RELEASE
>Organization:
>Environment:
FreeBSD orbitel.ru 7.1-RELEASE FreeBSD 7.1-RELEASE #4: Mon Feb 2 15:17:07 YEKT 2009 root at orbitel.ru:/usr/obj/usr/src/sys/CORE amd64
>Description:
I need to run a number of arpd's on different interfaces.
When I tried to run more than 16 arpd's - I got an "arpd: bad interface configuration: not IP or Ethernet" error.
Looking into the sources and debugging in got me into the max 32 bpf's restriction in libdnet.
(I think another 16 ones was used by other processes on my system)
>How-To-Repeat:
Try to run 33 arpd's. They can be on the same interface or on different interfaces - that does not matter.
Ypu should get an "arpd: bad interface configuration: not IP or Ethernet" error.
>Fix:
--- src/eth-bsd.c.orig 2009-04-16 14:22:44.000000000 +0600
+++ src/eth-bsd.c 2009-04-16 14:23:31.000000000 +0600
@@ -45,7 +45,7 @@
int i;
if ((e = calloc(1, sizeof(*e))) != NULL) {
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < 256; i++) {
snprintf(file, sizeof(file), "/dev/bpf%d", i);
e->fd = open(file, O_WRONLY);
if (e->fd != -1 || errno != EBUSY)
Patch attached with submission follows:
--- src/eth-bsd.c.orig 2009-04-16 14:22:44.000000000 +0600
+++ src/eth-bsd.c 2009-04-16 14:23:31.000000000 +0600
@@ -45,7 +45,7 @@
int i;
if ((e = calloc(1, sizeof(*e))) != NULL) {
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < 256; i++) {
snprintf(file, sizeof(file), "/dev/bpf%d", i);
e->fd = open(file, O_WRONLY);
if (e->fd != -1 || errno != EBUSY)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list