From patchwork Fri Oct 16 02:09:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriele Gristina X-Patchwork-Id: 54139 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9G2C2g1017070 for ; Fri, 16 Oct 2009 02:12:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbZJPCKP (ORCPT ); Thu, 15 Oct 2009 22:10:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755451AbZJPCKO (ORCPT ); Thu, 15 Oct 2009 22:10:14 -0400 Received: from mail-fx0-f218.google.com ([209.85.220.218]:54524 "EHLO mail-fx0-f218.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044AbZJPCKN (ORCPT ); Thu, 15 Oct 2009 22:10:13 -0400 Received: by fxm18 with SMTP id 18so1882562fxm.37 for ; Thu, 15 Oct 2009 19:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=+HMrrilWfJgHf1DrIz6bg6grltVHcTlaDgvXiZpemYg=; b=SqOI7bV1ElNhgt+hkbue2vC+yYv7ouMbcEpOATWXfM7TjS+jEMXV4FK0QwHdmT0GMD A6HGdPzmJHKk74vYRN/F6OOiHkV5UfCUdZkMdcv4ZrUe5asKxpF8FTddx5yM42DtB5dY FUT7Og5aEpnL7ioJjrlpbIRdKEBiBZCg+zG/I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=U3yKbdGiGQZBNH0LNQMbfnOisre/x2gMQ+HYJVI0QYCLH2Jg3DJ7fSdPK1q8hK0ff+ X7tHdO+GGyEd5gVhzPJXobD6wWEdxHyvfAom1u2/h7dUfJtdD52AWHbNm7mxgN5+EvlR zylJiBF3lS4JB/6HMQlHBa7RG5mdXX4ZigOFo= Received: by 10.204.141.3 with SMTP id k3mr674629bku.177.1255658976029; Thu, 15 Oct 2009 19:09:36 -0700 (PDT) Received: from ?192.168.1.156? (93-40-108-227.ip38.fastwebnet.it [93.40.108.227]) by mx.google.com with ESMTPS id y15sm970864fkd.28.2009.10.15.19.09.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 19:09:35 -0700 (PDT) Subject: [PATCH] mac80211: fixed injection in monitor mode From: Gabriele Gristina To: linux-wireless@vger.kernel.org Date: Fri, 16 Oct 2009 04:09:21 +0200 Message-Id: <1255658961.23827.2.camel@el8pc> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- net/mac80211/main.c.orig 2009-10-16 00:50:00.000000000 +0200 +++ net/mac80211/main.c 2009-10-15 23:06:03.000000000 +0200 @@ -607,6 +607,9 @@ skb->protocol = htons(ETH_P_802_2); memset(skb->cb, 0, sizeof(skb->cb)); + if (!(info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)) + goto out_no_echo; + rcu_read_lock(); list_for_each_entry_rcu(sdata, &local->interfaces, list) { if (sdata->vif.type == NL80211_IFTYPE_MONITOR) { @@ -630,7 +633,8 @@ skb = NULL; } rcu_read_unlock(); - dev_kfree_skb(skb); +out_no_echo: + if (skb) dev_kfree_skb(skb); } EXPORT_SYMBOL(ieee80211_tx_status);