From owner-freebsd-bugs@FreeBSD.ORG Sat May 12 12:30:17 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67C9316A400 for ; Sat, 12 May 2007 12:30:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 2FB8C13C469 for ; Sat, 12 May 2007 12:30:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l4CCUHGZ018132 for ; Sat, 12 May 2007 12:30:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l4CCUGH2018124; Sat, 12 May 2007 12:30:16 GMT (envelope-from gnats) Resent-Date: Sat, 12 May 2007 12:30:16 GMT Resent-Message-Id: <200705121230.l4CCUGH2018124@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yar Tikhiy Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3872416A403 for ; Sat, 12 May 2007 12:24:02 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from jujik.ramtel.ru (jujik.ramtel.ru [81.19.64.112]) by mx1.freebsd.org (Postfix) with ESMTP id B5E6313C46A for ; Sat, 12 May 2007 12:24:01 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from jujik.ramtel.ru (localhost [127.0.0.1]) by jujik.ramtel.ru (8.14.1/8.13.8) with ESMTP id l4CCO0J7068764 for ; Sat, 12 May 2007 16:24:00 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by jujik.ramtel.ru (8.14.1/8.13.8/Submit) id l4CCO0uj068763; Sat, 12 May 2007 16:24:00 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Message-Id: <200705121224.l4CCO0uj068763@jujik.ramtel.ru> Date: Sat, 12 May 2007 16:24:00 +0400 (MSD) From: Yar Tikhiy To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/112612: Traffic via additional lo(4) interface shows up on lo0 in bpf(4) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2007 12:30:17 -0000 >Number: 112612 >Category: kern >Synopsis: Traffic via additional lo(4) interface shows up on lo0 in bpf(4) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 12 12:30:15 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Yar Tikhiy >Release: FreeBSD 7.0-CURRENT i386 >Organization: none >Environment: System: FreeBSD jujik.ramtel.ru 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sun Apr 22 15:52:48 MSD 2007 root@jujik.ramtel.ru:/usr/src/sys/i386/compile/JTEST i386 >Description: tcpdump(1) on an additional loopback interface shows no traffic at all. The traffic can be seen if tcpdump(1) runs on the primary loopback interface instead, which is usually lo0. I believe that the bug was introduced in rev. 1.111 of if_loop.c. Due to that change, if_simloop() explicitly passes any loopback traffic to BPF on behalf of loif, i.e., the primary loopback interface. >How-To-Repeat: 1. Create an additional lo(4) interface: ifconfig lo1 create ifconfig lo1 127.0.0.2 2. Create ipfw rules to see that traffic actually goes via lo1: ipfw add 50 count icmp from any to any via lo0 ipfw add 50 count icmp from any to any via lo1 3. Start tcpdump on lo1: tcpdump -vpn -i lo1 icmp 4. Ping via lo1: ping -c1 127.0.0.1 5. See the counter increase on lo1, but no traffic in tcpdump. 6. Repeat #3,4 running tcpdump on lo0 instead, see the missing traffic showing up as though it flows via lo0. >Fix: Not know yet, but a promising approach is to test IFF_LOOPBACK on the actual interface, ifp, and not override it with loif in the bpf_mtap2() call if the flag is set. >Release-Note: >Audit-Trail: >Unformatted: