Date: Thu, 16 Apr 2009 08:35:43 GMT From: Andrey Zaikin <zed.0xff@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/133772: libdnet can only use /dev/bpfX, where X > 32 Message-ID: <200904160835.n3G8ZhF2008398@www.freebsd.org> Resent-Message-ID: <200904160840.n3G8e1ap024156@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904160835.n3G8ZhF2008398>