From patchwork Mon Feb 18 11:16:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 2157301 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5360ADF25A for ; Mon, 18 Feb 2013 11:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752Ab3BRLrW (ORCPT ); Mon, 18 Feb 2013 06:47:22 -0500 Received: from mail-da0-f43.google.com ([209.85.210.43]:43656 "EHLO mail-da0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705Ab3BRLrW (ORCPT ); Mon, 18 Feb 2013 06:47:22 -0500 Received: by mail-da0-f43.google.com with SMTP id u36so2451698dak.30 for ; Mon, 18 Feb 2013 03:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=SRoK3iih+NkrKfCtcg3ERw1URsL556CQpI+BpCgz3xQ=; b=PADvZg+iUYYcUp2d/2HZQpdkDMIIt08sF1rAJMdLHqP0ZnUujLwHRtJZNBBJSmIOUn /dyvGPLmliJTFwXbsKrtbN7013LQgDfj7Wr+50+4NIbwHjwJNZouRxi40dO6rN6w4e+X S5aAyUo833+ts0jsPX3RyuT6lGS/dkOXsamw8YtJ14/rVkb02Biar/QeeAX+GYWcg/Md 3j/ES07WOIVqBjxohCWekLm4uvxuui5A5IbxNLeknf+HKoLq71wxNy+BAC4RjWipoTtR gzKRTDAOMXdNpqOkCEEZeQ5Up6Z792QdOJNf4yIci/4Lq5AIfYIP3my7B9GuZkMUc7tT s1Lw== X-Received: by 10.66.82.35 with SMTP id f3mr34949979pay.49.1361188041669; Mon, 18 Feb 2013 03:47:21 -0800 (PST) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPS id c8sm14254786pbq.10.2013.02.18.03.47.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Feb 2013 03:47:20 -0800 (PST) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, thomas@cozybit.com, linville@tuxdriver.com, devel@lists.open80211s.org, cedric.voncken@acksys.fr, Chun-Yeow Yeoh Subject: [PATCH] mac80211: fix the problem of unicast forwarding from DS to DS in Mesh Date: Mon, 18 Feb 2013 19:16:47 +0800 Message-Id: <1361186207-1390-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Unicast frame with unknown forwarding information always trigger the path discovery assuming destination is always located inside the MBSS. This patch allows the forwarding to look for mesh gate if path discovery inside the MBSS has failed. Reported-by: Cedric Voncken Signed-off-by: Chun-Yeow Yeoh --- net/mac80211/tx.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5b9602b..dce3af3 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1844,9 +1844,18 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, } if (!is_multicast_ether_addr(skb->data)) { - mpath = mesh_path_lookup(sdata, skb->data); - if (!mpath) - mppath = mpp_path_lookup(sdata, skb->data); + struct sta_info *next_hop; + + mpath = mesh_path_lookup(skb->data, sdata); + if (mpath) + next_hop = rcu_dereference(mpath->next_hop); + + if (!mpath || (mpath && (!next_hop || + !(mpath->flags & MESH_PATH_ACTIVE)))) + mppath = mpp_path_lookup(skb->data, sdata); + + if (mppath && mpath) + mesh_path_del(mpath->dst, mpath->sdata); } /*