From owner-freebsd-wireless@FreeBSD.ORG Sun Aug 10 08:02:55 2014 Return-Path: Delivered-To: freebsd-wireless@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 ESMTPS id 78507455; Sun, 10 Aug 2014 08:02:55 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (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 183A2256A; Sun, 10 Aug 2014 08:02:55 +0000 (UTC) Received: by mail-qg0-f54.google.com with SMTP id z60so7533257qgd.41 for ; Sun, 10 Aug 2014 01:02: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=N2pVFlTcrQI7sHhImRcFlsYCPWOLJq8VjYaZdzFmrio=; b=b1jGoQ21Fz/7cDf49psjp1uWJiCBG/IyATp2VgrLrC/6A/KIgNxel5q+Gn1gH3nJxs cEqYXfS1Ea/HJKKT4+ktzLF3+bsiO6jRWqMts6W8sr2UDC3BzbQuZGzSiV8OfI/8wlmR gk/7ND1dAYMNnWKexqvG7RK2wu55XIodlarl+nqkm3H1M0eoqU7IA9+UFOi/KT4+Sfx4 F5B5DEOn1ixqy7Dx31CPxoUW6IZ6MMb653Uj1eQOLkzl7uuAc54DCjFx9kClMZ9EUK/v hMhquolIOdwhwuUkROGFFAR5f4UQvPjm3q08Zhsxlnl+RbHG+0X2MIycDkXdn6yvjuOr wVoA== MIME-Version: 1.0 X-Received: by 10.229.73.70 with SMTP id p6mr52293368qcj.13.1407657774195; Sun, 10 Aug 2014 01:02:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.41.6 with HTTP; Sun, 10 Aug 2014 01:02:54 -0700 (PDT) In-Reply-To: <80DB3DCF-496E-4596-B9F3-4D86AC82DEC5@FreeBSD.org> References: <80DB3DCF-496E-4596-B9F3-4D86AC82DEC5@FreeBSD.org> Date: Sun, 10 Aug 2014 01:02:54 -0700 X-Google-Sender-Auth: Kq-FoBV3ymBFn6OJH7SKLETfNqY Message-ID: Subject: Re: [rfc] INJECT mode for net80211 From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-wireless@freebsd.org" , "freebsd-arch@freebsd.org" 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Aug 2014 08:02:55 -0000 On 10 August 2014 00:54, Rui Paulo wrote: > On Aug 9, 2014, at 23:41, Adrian Chadd wrote: > >> 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 > > This patch looks incomplete. Did you forget to diff sys/net? Hm, try: http://people.freebsd.org/~adrian/ath/20140809-net80211-ath-inject-2.diff > In general, I'd prefer to have one mode. aircrack used to work in monitor mode, so I'm surprised the problem is the lack of an inject mode. Looking at the code, you're pretty much defining INJECT to be MONITOR mode. How did it used to work? * monitor mode very specifically doesn't define output methods at all; * there's no temporary nodes created when transmitting, so it all simply ends up being dropped because no txnode was found. So perhaps there was some path via the raw output method which no longer is working. The _output() method supposedly permits BPF injected packets to work by sending packets using a node == vap->iv_bss, but that can't possibly work with the existing monitor mode because code in ieee80211.c doesn't set the output methods for monitor mode. -a