From nobody@FreeBSD.org  Fri Aug 10 13:27:20 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 7215137B409
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 10 Aug 2001 13:27:20 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f7AKRKG95996;
	Fri, 10 Aug 2001 13:27:20 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200108102027.f7AKRKG95996@freefall.freebsd.org>
Date: Fri, 10 Aug 2001 13:27:20 -0700 (PDT)
From: Tommy Johnson <tjohnson@viacasting.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bridged packets diverted into userland with ipfw are not delivered to userland
X-Send-Pr-Version: www-1.0

>Number:         29613
>Category:       kern
>Synopsis:       bridged packets diverted into userland with ipfw are not delivered to userland
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 10 13:30:10 PDT 2001
>Closed-Date:    Sat Jul 13 14:45:19 PDT 2002
>Last-Modified:  Sat Jul 13 14:45:19 PDT 2002
>Originator:     Tommy Johnson
>Release:        4.4-PRERELEASE FreeBSD 4.4-PRERELEASE #2: Wed Aug  8 17:04:24
>Organization:
Viacast
>Environment:
FreeBSD antuin 4.4-PRERELEASE FreeBSD 4.4-PRERELEASE #2: Wed Aug  8 17:04:24 GMT 2001     tjohnson@antuin:/usr/src/sys/compile/ANTUIN  i386

>Description:
My goal is to build a satellite link simulator, and collect all the dropped packets.

setup an ethernet bridge, then divert packets into a divert socket.  While the packets properly leave the ipfw rules, they are never delivered to the divert socket itself.
>How-To-Repeat:

updev=xl0
backdev=xl1
printsocket=6975
upbw=10Mbits/sec
uplat=50
upplr=0.2
backbw=10Mbits/sec
backlat=50
backplr=0

sysctl -w net.link.ether.bridge_cfg="$updev:1,$backdev:1,"
sysctl -w net.link.ether.bridge=1
sysctl -w net.link.ether.bridge_ipfw=1

ipfw -q flush
ipfw -q pipe flush
ipfw pipe 10 config bw $upbw delay $uplat
ipfw pipe 11 config bw $backbw delay $backlat
ipfw add 90 prob $upplr   divert $printsocket ip from any to any via $updev   in
ipfw add 91 prob $backplr divert $printsocket ip from any to any via $backdev in
ipfw add 100 pipe 10 ip from any to any via $updev in
ipfw add 101 pipe 11 ip from any to any via $backdev in

Then run something which reads packets from a divert socket.  I used http://www.bobdbob.com/~protius/software/prettyprint.c.

Then run a ping or something through the ethernet bridge.  Note that while the packets are properly matched and removed from ipfw by rules 90 and 91, they are never delivered to prettyprint.
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: luigi 
State-Changed-When: Sat Jul 13 14:44:47 PDT 2002 
State-Changed-Why:  
divert is not supposed to work with bridged packets. 


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