From owner-freebsd-net@FreeBSD.ORG Tue Jun 27 22:13:44 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9604B16A40F for ; Tue, 27 Jun 2006 22:13:44 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1652B45CEA for ; Tue, 27 Jun 2006 22:13:43 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.6/8.13.6) with ESMTP id k5RMDf7W095473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Jun 2006 18:13:42 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from [172.21.130.86] (mx-broadway [38.98.68.18]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k5RMDZpc089916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Jun 2006 18:13:36 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: net@freebsd.org Date: Tue, 27 Jun 2006 18:13:29 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606271813.29980.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV 0.88/1568/Tue Jun 27 14:39:17 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: rizzo@icir.org Subject: using ipfw seems to interfere with socket communication X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 22:13:44 -0000 After I added the following rules to my ipfw configuration: ipfw pipe 1 config bw 2000000000Mbit/s ipfw add 200 pipe 1 tcp from any to any The following test from Tcl's regression-test suite started to fail: set s [socket -server accept 0] set sock "" set s2 [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]] vwait sock puts $s2 "one" flush $s2 after 500 fconfigure $sock -blocking 0 set result a:[gets $sock] lappend result b:[gets $sock] fconfigure $sock -blocking 1 puts $s2 "two" flush $s2 fconfigure $sock -blocking 0 lappend result c:[gets $sock] fconfigure $sock -blocking 1 close $s2 close $s close $sock set result Instead of the expected ``a:one b: c:two'', the result was consistently ``a:one b: c:''. This means, the gets in the line: lappend result c:[gets $sock] was always returning empty string, instead of the string "two", that was written into the socket and flushed. Is the test wrong, and such result is possible, or is dummynet triggering a bug? Unloading the dummynet module allows the test to succeed... Thanks! -mi