From owner-freebsd-net@FreeBSD.ORG Thu Oct 10 12:24:55 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 76E60C7F; Thu, 10 Oct 2013 12:24:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x22f.google.com (mail-qe0-x22f.google.com [IPv6:2607:f8b0:400d:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 259BD2765; Thu, 10 Oct 2013 12:24:55 +0000 (UTC) Received: by mail-qe0-f47.google.com with SMTP id b4so1777358qen.6 for ; Thu, 10 Oct 2013 05:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=D7sikeDMJD3WMh6NBKd2puEPUvWh6KMSqtcN+810Fcw=; b=A/5naT7kkplFuLwIXXsGI6HtPpXYYZ1hEPIR/ls1dkKxwdpEfLXyNTM84PuaEJuwHe 9A5UqYnLU/Jo9JMl67WyLSJtTcG4v6VB8yjNE1RAYFYcDhkB6a+4RWHIwaBLxjRF5mnf K9dwOzZ9P44uS3vG7mLrrhX/lKaEL+JXxuLWZrFDJdrTgxPnRD0UUxPD0GxyZpJN2ttn Q2J7PnenuiIRtFE7PkMR6RuVs+mwl5iEkl18NZKAofEYCHHq8mJxqeXHeMMOvDiKpsCW ArdcDnR+mZN7aOyJnX0hhtRYzJyeKQc/Nz3LmZ/qqZ2sJWfBStcTttjfNztkZ6nJ+kV+ wvcg== MIME-Version: 1.0 X-Received: by 10.229.38.202 with SMTP id c10mr9634473qce.23.1381407894288; Thu, 10 Oct 2013 05:24:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Thu, 10 Oct 2013 05:24:54 -0700 (PDT) In-Reply-To: References: Date: Thu, 10 Oct 2013 05:24:54 -0700 X-Google-Sender-Auth: jtxOSjn7IDnRMVrbPnmtvLSjMac Message-ID: Subject: Re: [ieee80211] [patch] BPF taps not working for ieee80211 interfaces in monitor mode From: Adrian Chadd To: Patrick Kelsey Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Net , "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2013 12:24:55 -0000 On 9 October 2013 17:27, Patrick Kelsey wrote: > Hi, > > A bug was introduced in r254082 that results in BPF taps never being > enabled for ieee80211 interfaces that are in monitor mode. > > Before r254082, bpf_track() in sys/net80211/ieee80211_freebsd.c was > identifying ieee80211 interfaces by checking to see if the value of > the ifp->if_start pointer was equal to ieee80211_start. r254082 was a > move away from using if_start to using if_transmit in the ieee80211 > stack, and bpf_track() was correspondingly updated to check the value > of ifp->if_transmit against ieee80211_vap_transmit. The problem is > that ifp->if_transmit is set to null_transmit by > ieee80211_vap_attach() in sys/net80211/ieee80211.c for interfaces that > are in monitor mode (code that has been in place since r195846). > > One fix that resolves the issue is to use what is likely to be a more > stable signature in the check in bpf_track(). > > A patch against r256155 is attached. > Hi! Good catch! Yeah, this is all very dirty code that needs to be ripped out. I'll get this committed ASAP. Thanks! -adrian