From owner-freebsd-wireless@FreeBSD.ORG  Sun Aug 10 06:41:33 2014
Return-Path: <owner-freebsd-wireless@FreeBSD.ORG>
Delivered-To: freebsd-wireless@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 ESMTPS id 51B2EFDA;
 Sun, 10 Aug 2014 06:41:33 +0000 (UTC)
Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com
 [IPv6:2607:f8b0:400d:c01::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 063922D4E;
 Sun, 10 Aug 2014 06:41:32 +0000 (UTC)
Received: by mail-qc0-f173.google.com with SMTP id w7so647188qcr.32
 for <multiple recipients>; Sat, 09 Aug 2014 23:41:32 -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=pg6zNhqKtd7w3wYqd7Gp0NaPTyTmjwbvfnlf0qUhEkA=;
 b=XfL+61wnKbZ+CvXPddbH2PG/UXVga4X6VRFnc6ji/B6vuXibt5onQS5Kgwj7s67pyW
 EduIiI8i+97tjJjVGiQG8V5P0d73a1taOtUxoiCgB6bXj6ulkmlhCvm8SUdDsk7RCg5H
 SXiDpM8urSlEH13NOBWNQlmKhQMuJRlGYx+W/0mZ6YdDgEz0tAL2OFeP9INK5m5WpvB6
 96GYXeEWWs6dzLye+MQhLddoma6iJ2bGKD8UbN75pwmOAb9dTnAlZ3vtL99D3TboZHpq
 o3vThGegGICH/d2SbNEU2Hn+/0mgWXYNOo4ADAdsLfIUsaLNQu2oPTadriRUOZfl2+sK
 BzoQ==
MIME-Version: 1.0
X-Received: by 10.140.41.133 with SMTP id z5mr36483236qgz.99.1407652892080;
 Sat, 09 Aug 2014 23:41:32 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.41.6 with HTTP; Sat, 9 Aug 2014 23:41:32 -0700 (PDT)
Date: Sat, 9 Aug 2014 23:41:32 -0700
X-Google-Sender-Auth: LbUeRuk5SmZyiL3t9SIeH9yWlu0
Message-ID: <CAJ-VmonhQwdQcTcEGrvwiTBDxiaOUAGYo=g+TaACR9oJaAh8Bw@mail.gmail.com>
Subject: [rfc] INJECT mode for net80211
From: Adrian Chadd <adrian@freebsd.org>
To: "freebsd-wireless@freebsd.org" <freebsd-wireless@freebsd.org>, 
 "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Content-Type: text/plain; charset=UTF-8
X-BeenThere: freebsd-wireless@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: "Discussions of 802.11 stack,
 tools device driver development." <freebsd-wireless.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-wireless>, 
 <mailto:freebsd-wireless-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-wireless/>
List-Post: <mailto:freebsd-wireless@freebsd.org>
List-Help: <mailto:freebsd-wireless-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-wireless>, 
 <mailto:freebsd-wireless-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 10 Aug 2014 06:41:33 -0000

Hi!

I kinda got fed up with the lack of functioning inject.

* monitor mode isn't inject mode;
* ahdemo mode seems .. less useful.

So I just created IEEE80211_M_INJECT and taught net80211 / ath about
it. This is like monitor mode (straight to RUN, no need to set an
SSID, no auto scanning by default) but it allows transmit and
populates the node table with temporary node entries.

So:

http://people.freebsd.org/~adrian/ath/20140809-net80211-ath-inject-1.diff

I'd like to commit this in the next couple of days.

I've also tested this with aircrack-ng - the built port didn't work
with monitor mode modified to inject frames. I don't know why. Rebuilt
from source worked fine. I've just modified my local copy to set the
IFM_IEEE80211_INJECT flag rather than monitor flag and it seems it's
all okay.

The only issue I've seen with packet injection is that aircrack-ng
isn't waiting until the interface is up before trying to send frames,
so some are rejected rather than buffered.



-a