From patchwork Wed Aug 12 18:03:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 40933 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 n7CIFvds021138 for ; Wed, 12 Aug 2009 18:15:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752778AbZHLSP1 (ORCPT ); Wed, 12 Aug 2009 14:15:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752543AbZHLSP0 (ORCPT ); Wed, 12 Aug 2009 14:15:26 -0400 Received: from rv-out-0506.google.com ([209.85.198.238]:38253 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752758AbZHLSPZ (ORCPT ); Wed, 12 Aug 2009 14:15:25 -0400 Received: by rv-out-0506.google.com with SMTP id f6so67731rvb.1 for ; Wed, 12 Aug 2009 11:15:26 -0700 (PDT) Received: by 10.140.133.20 with SMTP id g20mr169367rvd.26.1250100926303; Wed, 12 Aug 2009 11:15:26 -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 g14sm6799980rvb.50.2009.08.12.11.15.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 Aug 2009 11:15:23 -0700 (PDT) From: Javier Cardona To: linux-wireless@vger.kernel.org Cc: David Woo , Javier Cardona , andrey@cozybit.com, johannes@sipsolutions.net, linville@tuxdriver.com, devel@lists.open80211s.org Subject: [PATCH 1/2] mac80211: Mark a destination sequence number as valid when a PREQ is received. Date: Wed, 12 Aug 2009 11:03:43 -0700 Message-Id: <1250100224-23832-2-git-send-email-javier@cozybit.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1250100224-23832-1-git-send-email-javier@cozybit.com> References: <4A82639F.6000908@realsil.com.cn> <1250100224-23832-1-git-send-email-javier@cozybit.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: David Woo If a PREQ frame is received giving us a fresher DSN than what we have, record the new dsn and mark it as valid. This patch fixes a bug in the setting of the MESH_PATH_DSN_VALID flag. Also, minor fix to coding style on that file. Signed-off-by: Javier Cardona --- net/mac80211/mesh_hwmp.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 1cd1e72..ef1efd3 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -397,7 +397,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, - u8 *preq_elem, u32 metric) { + u8 *preq_elem, u32 metric) +{ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; struct mesh_path *mpath; u8 *dst_addr, *orig_addr; @@ -430,7 +431,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, if ((!(mpath->flags & MESH_PATH_DSN_VALID)) || DSN_LT(mpath->dsn, dst_dsn)) { mpath->dsn = dst_dsn; - mpath->flags &= MESH_PATH_DSN_VALID; + mpath->flags |= MESH_PATH_DSN_VALID; } else if ((!(dst_flags & MP_F_DO)) && (mpath->flags & MESH_PATH_ACTIVE)) { reply = true;