From patchwork Tue Aug 11 11:47:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Woo X-Patchwork-Id: 40577 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 n7BC5TIj028866 for ; Tue, 11 Aug 2009 12:05:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752476AbZHKMB2 (ORCPT ); Tue, 11 Aug 2009 08:01:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752609AbZHKMBY (ORCPT ); Tue, 11 Aug 2009 08:01:24 -0400 Received: from rtitmf2.realtek.com ([60.250.210.236]:4820 "EHLO mf2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752303AbZHKL7e (ORCPT ); Tue, 11 Aug 2009 07:59:34 -0400 X-Greylist: delayed 304 seconds by postgrey-1.27 at vger.kernel.org; Tue, 11 Aug 2009 07:59:31 EDT Received: from RSEX1.realsil.com.cn (unverified [172.29.17.2]) by mf2.realtek.com.tw (Clearswift SMTPRS 5.1.7) with ESMTP id ; Tue, 11 Aug 2009 19:47:03 +0800 Received: from [172.29.34.2] (172.29.34.2) by RSEX1.realsil.com.cn (172.29.17.2) with Microsoft SMTP Server id 8.1.358.0; Tue, 11 Aug 2009 19:46:54 +0800 Message-ID: <4A815A3B.3080404@realsil.com.cn> Date: Tue, 11 Aug 2009 19:47:07 +0800 From: david woo User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Johannes Berg CC: "javier@cozybit.com" , "linux-wireless@vger.kernel.org" , "andrey@cozybit.com" , "linville@tuxdriver.com" , "devel@lists.open80211s.org" Subject: Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c References: <1249986145-6531-1-git-send-email-xinhua_wu@realsil.com.cn> <1249987806.5705.0.camel@johannes.local> In-Reply-To: <1249987806.5705.0.camel@johannes.local> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Johannes Berg 写道: > On Tue, 2009-08-11 at 18:22 +0800, David Woo wrote: >> 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) { > > And other than adding this coding style mistake, what does this patch > do? > > johannes It's my first time to submit the patch file, I just mean to submit the attched patch file. [PATCH] mac80211: Fix preq frame process and peer link frame baselen. This patch is just to fix rreq reply condition, and peer link confirm frame baselen. Signed-off-by: David Woo --- David diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index e1a763e..c065854 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; @@ -447,14 +448,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, if (reply) { lifetime = PREQ_IE_LIFETIME(preq_elem); - ttl = ifmsh->mshcfg.dot11MeshTTL; - if (ttl != 0) + ttl = PREQ_IE_TTL(preq_elem); + if (ttl != 0) { + ttl = ifmsh->mshcfg.dot11MeshTTL; mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr, cpu_to_le32(dst_dsn), 0, orig_addr, cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl, cpu_to_le32(lifetime), cpu_to_le32(metric), 0, sdata); - else + } else ifmsh->mshstats.dropped_frames_ttl++; } diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index cb14253..ffcbad7 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt; if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) { baseaddr += 4; - baselen -= 4; + baselen += 4; } ieee802_11_parse_elems(baseaddr, len - baselen, &elems); if (!elems.peer_link) {