From patchwork Tue Feb 19 02:04:50 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: 2160931 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 343603FDF1 for ; Tue, 19 Feb 2013 02:35:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758029Ab3BSCfd (ORCPT ); Mon, 18 Feb 2013 21:35:33 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:42005 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758052Ab3BSCfb (ORCPT ); Mon, 18 Feb 2013 21:35:31 -0500 Received: by mail-pa0-f45.google.com with SMTP id kl14so3144702pab.32 for ; Mon, 18 Feb 2013 18:35:31 -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=KPzL8ANk9aMqNYTO0iTOOYpQYNuopm6z4pelDhpE1wM=; b=hLS4qkcK1CyxutO5XwH/X1RFnR8P3Ws2gd4RNzmuE4+dA2/3H2/ivk/Cbi10mYihUE plQ5mIqvtBl3S/E2LIDaV1djtajAAREuPa+qWKC2rpHU1QUMYOwlw/AwGSxKQXIZO4zQ CV7+QSe4SCZzc7meF/4bxXyjEZNn0e+U+HJ0N8ObRn0qqx2kTfty2OUvcB7q5+X5NrmH keH1SD35SKZbElaCNPgPsHGWg2yApdcaNcCNWRkgp3/K2wYBKi6o0E6ZmMRq3osLe9MQ 9W9z3zt6X1iQbZxngcimJWjAzw4LNIQnJ/Nv4kXHEV+Ac/8BwIhNmY4a1I3RwM8LI2DI LAFw== X-Received: by 10.66.79.231 with SMTP id m7mr41183237pax.76.1361241331069; Mon, 18 Feb 2013 18:35:31 -0800 (PST) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPS id qp13sm16273249pbb.3.2013.02.18.18.35.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Feb 2013 18:35:30 -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 v2] mac80211: fix the problem of forwarding from DS to DS in Mesh Date: Tue, 19 Feb 2013 10:04:50 +0800 Message-Id: <1361239490-4630-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 --- v2: rebase on mac80211-next and redefine the logic clearer (Johannes & Thomas) net/mac80211/tx.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5b9602b..c79860f 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1844,9 +1844,24 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, } if (!is_multicast_ether_addr(skb->data)) { + struct sta_info *next_hop; + bool mpp_lookup = true; + mpath = mesh_path_lookup(sdata, skb->data); - if (!mpath) + if (mpath) { + mpp_lookup = false; + next_hop = rcu_dereference(mpath->next_hop); + if (!next_hop || + !(mpath->flags & (MESH_PATH_ACTIVE | + MESH_PATH_RESOLVING))) + mpp_lookup = true; + } + + if (mpp_lookup) mppath = mpp_path_lookup(sdata, skb->data); + + if (mppath && mpath) + mesh_path_del(mpath->sdata, mpath->dst); } /*