From owner-freebsd-net@FreeBSD.ORG Thu Oct 10 00:27:57 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB1DFE76 for ; Thu, 10 Oct 2013 00:27:57 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-bk0-x22d.google.com (mail-bk0-x22d.google.com [IPv6:2a00:1450:4008:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52012214F for ; Thu, 10 Oct 2013 00:27:57 +0000 (UTC) Received: by mail-bk0-f45.google.com with SMTP id mx11so684595bkb.32 for ; Wed, 09 Oct 2013 17:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=KzeKy5IJ4btaZ9Tebge2Y9qKrsjhyBKhXy5SxiD7FcI=; b=SorxNq1T/dGqq6bI1YlH6N5gNJOAXn8GLkubPFdh4PkQY82XPWjArrgdlCb2mvnYiw S6AW02476UgXLm/YaGEk9AdMsfIE69Nf74Zi/FJqLVoSiLAuzXtadoI6DiLzLMdDhLCK nDHXTeYYxQMFYjbIrxRHnWfJopDPmtpmELT7OT8WcJR53jTegZscKm8q0vaCq4o2RcFf n0qPpDF0JyyfhIrWlHC0w4PynCsabBMXfbQ4oRHZQFAft2WkHyKhXQg7Y02pbe3hcf+M GhAGQ380eI7nR4DXyNqb+Df4R+uPmms7vVipyUo/7uNiZ7dPsYp5YFt0054x02EkRLkr 80JQ== MIME-Version: 1.0 X-Received: by 10.204.69.12 with SMTP id x12mr9489752bki.12.1381364875529; Wed, 09 Oct 2013 17:27:55 -0700 (PDT) Sender: pkelsey@gmail.com Received: by 10.204.232.7 with HTTP; Wed, 9 Oct 2013 17:27:55 -0700 (PDT) Date: Wed, 9 Oct 2013 20:27:55 -0400 X-Google-Sender-Auth: ks-VQWKe5FOxJGm91Nv5T7u2dNQ Message-ID: Subject: [ieee80211] [patch] BPF taps not working for ieee80211 interfaces in monitor mode From: Patrick Kelsey To: freebsd-net@freebsd.org Content-Type: multipart/mixed; boundary=001a1132ec90b640b204e8581211 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 00:27:57 -0000 --001a1132ec90b640b204e8581211 Content-Type: text/plain; charset=ISO-8859-1 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. -Patrick --001a1132ec90b640b204e8581211 Content-Type: application/octet-stream; name="ieee80211_bpf_track.patch" Content-Disposition: attachment; filename="ieee80211_bpf_track.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hml8uphc0 SW5kZXg6IHN5cy9uZXQ4MDIxMS9pZWVlODAyMTFfZnJlZWJzZC5jCj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5 cy9uZXQ4MDIxMS9pZWVlODAyMTFfZnJlZWJzZC5jCShyZXZpc2lvbiAyNTYxNTUpCisrKyBzeXMv bmV0ODAyMTEvaWVlZTgwMjExX2ZyZWVic2QuYwkod29ya2luZyBjb3B5KQpAQCAtODA4LDkgKzgw OCw5IEBACiBzdGF0aWMgdm9pZAogYnBmX3RyYWNrKHZvaWQgKmFyZywgc3RydWN0IGlmbmV0ICpp ZnAsIGludCBkbHQsIGludCBhdHRhY2gpCiB7Ci0JLyogTkI6IGlkZW50aWZ5IHZhcCdzIGJ5IGlm X3N0YXJ0ICovCisJLyogTkI6IGlkZW50aWZ5IHZhcCdzIGJ5IGlmX2luaXQgKi8KIAlpZiAoZGx0 ID09IERMVF9JRUVFODAyXzExX1JBRElPICYmCi0JICAgIGlmcC0+aWZfdHJhbnNtaXQgPT0gaWVl ZTgwMjExX3ZhcF90cmFuc21pdCkgeworCSAgICBpZnAtPmlmX2luaXQgPT0gaWVlZTgwMjExX2lu aXQpIHsKIAkJc3RydWN0IGllZWU4MDIxMXZhcCAqdmFwID0gaWZwLT5pZl9zb2Z0YzsKIAkJLyoK IAkJICogVHJhY2sgYnBmIHJhZGlvdGFwIGxpc3RlbmVyIHN0YXRlLiAgV2UgbWFyayB0aGUgdmFw Cg== --001a1132ec90b640b204e8581211--