From patchwork Fri Oct 16 01:10:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 54138 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 n9G1XK4E012697 for ; Fri, 16 Oct 2009 01:33:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbZJPB2k (ORCPT ); Thu, 15 Oct 2009 21:28:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758888AbZJPB2k (ORCPT ); Thu, 15 Oct 2009 21:28:40 -0400 Received: from mail-ew0-f208.google.com ([209.85.219.208]:52653 "EHLO mail-ew0-f208.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758874AbZJPB2j (ORCPT ); Thu, 15 Oct 2009 21:28:39 -0400 Received: by ewy4 with SMTP id 4so1162289ewy.37 for ; Thu, 15 Oct 2009 18:28:03 -0700 (PDT) Received: by 10.211.128.15 with SMTP id f15mr737995ebn.84.1255656482908; Thu, 15 Oct 2009 18:28:02 -0700 (PDT) Received: from localhost (adsl-71-156-104-53.dsl.pltn13.sbcglobal.net [71.156.104.53]) by mx.google.com with ESMTPS id 7sm3847380eyb.16.2009.10.15.18.28.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 18:28:01 -0700 (PDT) From: Javier Cardona To: linux-wireless@vger.kernel.org Cc: Javier Cardona , andrey@cozybit.com, johannes@sipsolutions.net, linville@tuxdriver.com, devel@lists.open80211s.org, rpaulo@gmail.com, dreamfly281@gmail.com Subject: [PATCH] mac80211: Learn about mesh portals from multicast traffic Date: Thu, 15 Oct 2009 18:10:51 -0700 Message-Id: <1255655451-28830-1-git-send-email-javier@cozybit.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <> References: <> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 7170bf4..5c385e3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1504,19 +1504,28 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) /* illegal frame */ return RX_DROP_MONITOR; - if (!is_multicast_ether_addr(hdr->addr1) && - (mesh_hdr->flags & MESH_FLAGS_AE_A5_A6)) { + if (mesh_hdr->flags & MESH_FLAGS_AE) { struct mesh_path *mppath; + char *proxied_addr; + char *mpp_addr; + + if (is_multicast_ether_addr(hdr->addr1)) { + mpp_addr = hdr->addr3; + proxied_addr = mesh_hdr->eaddr1; + } else { + mpp_addr = hdr->addr4; + proxied_addr = mesh_hdr->eaddr2; + } rcu_read_lock(); - mppath = mpp_path_lookup(mesh_hdr->eaddr2, sdata); + mppath = mpp_path_lookup(proxied_addr, sdata); if (!mppath) { - mpp_path_add(mesh_hdr->eaddr2, hdr->addr4, sdata); + mpp_path_add(proxied_addr, mpp_addr, sdata); } else { spin_lock_bh(&mppath->state_lock); mppath->exp_time = jiffies; - if (compare_ether_addr(mppath->mpp, hdr->addr4) != 0) - memcpy(mppath->mpp, hdr->addr4, ETH_ALEN); + if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) + memcpy(mppath->mpp, mpp_addr, ETH_ALEN); spin_unlock_bh(&mppath->state_lock); } rcu_read_unlock();