From marck@woozle.rinet.ru  Mon May 29 11:13:07 2006
Return-Path: <marck@woozle.rinet.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3197216A421
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 May 2006 11:13:07 +0000 (UTC)
	(envelope-from marck@woozle.rinet.ru)
Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6C96343D53
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 May 2006 11:13:06 +0000 (GMT)
	(envelope-from marck@woozle.rinet.ru)
Received: from woozle.rinet.ru (localhost [127.0.0.1])
	by woozle.rinet.ru (8.13.6/8.13.6) with ESMTP id k4TBD4bp075777
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 May 2006 15:13:04 +0400 (MSD)
	(envelope-from marck@woozle.rinet.ru)
Received: (from marck@localhost)
	by woozle.rinet.ru (8.13.6/8.13.6/Submit) id k4TBD4NP075776;
	Mon, 29 May 2006 15:13:04 +0400 (MSD)
	(envelope-from marck)
Message-Id: <200605291113.k4TBD4NP075776@woozle.rinet.ru>
Date: Mon, 29 May 2006 15:13:04 +0400 (MSD)
From: Dmitry Morozovsky <marck@freebsd.org>
Reply-To: Dmitry Morozovsky <marck@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: security/nmap patch for bpf open
X-Send-Pr-Version: 3.113
X-GNATS-Notify: daniel@roe.ch

>Number:         98080
>Category:       ports
>Synopsis:       security/nmap patch for bpf open
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 29 11:20:17 GMT 2006
>Closed-Date:    Tue Jun 06 01:32:18 GMT 2006
>Last-Modified:  Tue Jun 06 01:32:18 GMT 2006
>Originator:     Dmitry Morozovsky
>Release:        FreeBSD 6-STABLE i386
>Organization:
Cronyx Plus LLC (RiNet ISP)
>Environment:
System: FreeBSD 6-STABLE 


>Description:

security/nmap fails to attach to bpf when more than 128 bpfs are busy.


>How-To-Repeat:

>Fix:

I'm not sure what limit should we set, but 1024 seems reasonable for me, and it does work on real-load router with 450+ VLANs.

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/security/nmap/Makefile,v
retrieving revision 1.98
diff -u -r1.98 Makefile
--- Makefile	15 Mar 2006 14:30:41 -0000	1.98
+++ Makefile	29 May 2006 11:02:06 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME?=	nmap
 PORTVERSION=	${DISTVERSION:L:C/([a-z])[a-z]+/\1/g:C/[^a-z0-9+]+/./g}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	security ipv6
 MASTER_SITES=	http://download.insecure.org/nmap/dist/ \
 		http://www.mirrors.wiretapped.net/security/network-mapping/nmap/ \
Index: files/patch-libdnet-stripped_src_eth-bsd.c
===================================================================
RCS file: files/patch-libdnet-stripped_src_eth-bsd.c
diff -N files/patch-libdnet-stripped_src_eth-bsd.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-libdnet-stripped_src_eth-bsd.c	29 May 2006 11:02:06 -0000
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- libdnet-stripped/src/eth-bsd.c.orig
++++ libdnet-stripped/src/eth-bsd.c
+@@ -45,7 +45,7 @@
+ 	int i;
+ 
+ 	if ((e = calloc(1, sizeof(*e))) != NULL) {
+-		for (i = 0; i < 128; i++) {
++		for (i = 0; i < 1024; 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:
Responsible-Changed-From-To: freebsd-ports-bugs->marck 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon May 29 11:36:13 UTC 2006 
Responsible-Changed-Why:  
Submitter is a commiter 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98080 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon May 29 11:36:22 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98080 

From: Daniel Roethlisberger <daniel@roe.ch>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/98080: security/nmap patch for bpf open
Date: Thu, 1 Jun 2006 23:22:04 +0200

 I approve.  Thanks for the patch!
 
 -- 
 Daniel Roethlisberger
State-Changed-From-To: feedback->open 
State-Changed-By: edwin 
State-Changed-When: Fri Jun 2 12:08:29 UTC 2006 
State-Changed-Why:  
maintainer approved 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98080 
Responsible-Changed-From-To: marck->freebsd-ports-bugs 
Responsible-Changed-By: marck 
Responsible-Changed-When: Mon Jun 5 12:11:37 UTC 2006 
Responsible-Changed-Why:  
I'm not ports committer, so release this to the pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98080 
State-Changed-From-To: open->closed 
State-Changed-By: mnag 
State-Changed-When: Tue Jun 6 01:32:16 UTC 2006 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98080 
>Unformatted:
