* diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c @ 2009-08-11 10:22 David Woo 2009-08-11 10:50 ` Johannes Berg 0 siblings, 1 reply; 10+ messages in thread From: David Woo @ 2009-08-11 10:22 UTC (permalink / raw) To: javier; +Cc: linux-wireless, andrey, johannes, linville, devel 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; @@ -431,7 +430,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; @@ -448,15 +447,14 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, if (reply) { lifetime = PREQ_IE_LIFETIME(preq_elem); - ttl = PREQ_IE_TTL(preq_elem); - if (ttl != 0) { - ttl = ifmsh->mshcfg.dot11MeshTTL; + ttl = ifmsh->mshcfg.dot11MeshTTL; + if (ttl != 0) 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 ffcbad7..cb14253 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) { ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-11 10:22 diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c David Woo @ 2009-08-11 10:50 ` Johannes Berg 2009-08-11 11:47 ` david woo 0 siblings, 1 reply; 10+ messages in thread From: Johannes Berg @ 2009-08-11 10:50 UTC (permalink / raw) To: David Woo; +Cc: javier, linux-wireless, andrey, linville, devel [-- Attachment #1: Type: text/plain, Size: 346 bytes --] 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 [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 801 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-11 10:50 ` Johannes Berg @ 2009-08-11 11:47 ` david woo 2009-08-11 18:47 ` John W. Linville 2009-08-12 1:42 ` Javier Cardona 0 siblings, 2 replies; 10+ messages in thread From: david woo @ 2009-08-11 11:47 UTC (permalink / raw) To: Johannes Berg; +Cc: javier, linux-wireless, andrey, linville, devel [-- Attachment #1: Type: text/plain, Size: 2745 bytes --] 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 <xinhua_wu@realsil.com.cn> --- 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) { David [-- Attachment #2: mesh.patch --] [-- Type: text/x-patch, Size: 2053 bytes --] 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) { ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-11 11:47 ` david woo @ 2009-08-11 18:47 ` John W. Linville 2009-08-12 0:33 ` 吴新华 2009-08-12 1:42 ` Javier Cardona 1 sibling, 1 reply; 10+ messages in thread From: John W. Linville @ 2009-08-11 18:47 UTC (permalink / raw) To: david woo; +Cc: Johannes Berg, javier, linux-wireless, andrey, devel David, thanks for the patch! Unfortunately, I'm not really sure what you are fixing. Could you change your changelog to explain what problem you are fixing? Just telling me that you changed something doesn't tell me what was wrong with it in the first place. Also, please make sure you follow the suggestions here: http://linux.yyz.us/patch-format.html I look forward to your next post...thanks! John On Tue, Aug 11, 2009 at 07:47:07PM +0800, david woo wrote: > 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 <xinhua_wu@realsil.com.cn> > --- > 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) { > > > 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) { -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready. ^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-11 18:47 ` John W. Linville @ 2009-08-12 0:33 ` 吴新华 0 siblings, 0 replies; 10+ messages in thread From: 吴新华 @ 2009-08-12 0:33 UTC (permalink / raw) To: John W. Linville; +Cc: Johannes Berg, javier, linux-wireless, andrey, devel X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQpGcm9tOiBKb2huIFcuIExp bnZpbGxlIFtsaW52aWxsZUB0dXhkcml2ZXIuY29tXQ0KU2VudDogV2VkbmVzZGF5LCBBdWd1c3Qg MTIsIDIwMDkgMjo0NyBBTQ0KVG86IM7i0MK7qg0KQ2M6IEpvaGFubmVzIEJlcmc7IGphdmllckBj b3p5Yml0LmNvbTsgbGludXgtd2lyZWxlc3NAdmdlci5rZXJuZWwub3JnOyBhbmRyZXlAY296eWJp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ICAgICAgICAgICAgIHN0cnVjdCBpZWVlODAyMTFfbWdtdCAqbWdtdCwNCj4gLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwcmVxX2VsZW0sIHUzMiBtZXRyaWMpIHsNCj4g KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU4ICpwcmVxX2VsZW0sIHUzMiBtZXRy aWMpDQo+ICt7DQo+ICAgICAgIHN0cnVjdCBpZWVlODAyMTFfaWZfbWVzaCAqaWZtc2ggPSAmc2Rh dGEtPnUubWVzaDsNCj4gICAgICAgc3RydWN0IG1lc2hfcGF0aCAqbXBhdGg7DQo+ICAgICAgIHU4 ICpkc3RfYWRkciwgKm9yaWdfYWRkcjsNCj4gQEAgLTQzMCw3ICs0MzEsNyBAQCBzdGF0aWMgdm9p ZCBod21wX3ByZXFfZnJhbWVfcHJvY2VzcyhzdHJ1Y3QgaWVlZTgwMjExX3N1Yl9pZl9kYXRhICpz ZGF0YSwNCj4gICAgICAgICAgICAgICAgICAgICAgIGlmICgoIShtcGF0aC0+ZmxhZ3MgJiBNRVNI X1BBVEhfRFNOX1ZBTElEKSkgfHwNCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBEU05fTFQobXBhdGgtPmRzbiwgZHN0X2RzbikpIHsNCj4gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgbXBhdGgtPmRzbiA9IGRzdF9kc247DQo+IC0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1wYXRoLT5mbGFncyAmPSBNRVNIX1BBVEhfRFNOX1ZBTElEOw0KPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBtcGF0aC0+ZmxhZ3MgfD0gTUVTSF9QQVRIX0RTTl9WQUxJ RDsNCj4gICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoKCEoZHN0X2ZsYWdzICYgTVBf Rl9ETykpICYmDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1wYXRo LT5mbGFncyAmIE1FU0hfUEFUSF9BQ1RJVkUpKSB7DQo+ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHJlcGx5ID0gdHJ1ZTsNCj4gQEAgLTQ0NywxNCArNDQ4LDE1IEBAIHN0YXRpYyB2b2lk IGh3bXBfcHJlcV9mcmFtZV9wcm9jZXNzKHN0cnVjdCBpZWVlODAyMTFfc3ViX2lmX2RhdGEgKnNk YXRhLA0KPg0KPiAgICAgICBpZiAocmVwbHkpIHsNCj4gICAgICAgICAgICAgICBsaWZldGltZSA9 IFBSRVFfSUVfTElGRVRJTUUocHJlcV9lbGVtKTsNCj4gLSAgICAgICAgICAgICB0dGwgPSBpZm1z aC0+bXNoY2ZnLmRvdDExTWVzaFRUTDsNCj4gLSAgICAgICAgICAgICBpZiAodHRsICE9IDApDQo+ ICsgICAgICAgICAgICAgdHRsID0gUFJFUV9JRV9UVEwocHJlcV9lbGVtKTsNCj4gKyAgICAgICAg ICAgICBpZiAodHRsICE9IDApIHsNCj4gKyAgICAgICAgICAgICAgICAgICAgIHR0bCA9IGlmbXNo LT5tc2hjZmcuZG90MTFNZXNoVFRMOw0KPiAgICAgICAgICAgICAgICAgICAgICAgbWVzaF9wYXRo X3NlbF9mcmFtZV90eChNUEFUSF9QUkVQLCAwLCBkc3RfYWRkciwNCj4gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIoZHN0X2RzbiksIDAsIG9yaWdfYWRkciwNCj4gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIob3JpZ19kc24pLCBtZ210LT5z YSwgMCwgdHRsLA0KPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcHVfdG9fbGUzMihs aWZldGltZSksIGNwdV90b19sZTMyKG1ldHJpYyksDQo+ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDAsIHNkYXRhKTsNCj4gLSAgICAgICAgICAgICBlbHNlDQo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05fTFQobXBhdGgtPmRzbiwgZHN0X2RzbikpIHsNCj4g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXBhdGgtPmRzbiA9IGRzdF9kc247DQo+IC0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1wYXRoLT5mbGFncyAmPSBNRVNIX1BBVEhfRFNO X1ZBTElEOw0KPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcGF0aC0+ZmxhZ3MgfD0g TUVTSF9QQVRIX0RTTl9WQUxJRDsNCj4gICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAo KCEoZHN0X2ZsYWdzICYgTVBfRl9ETykpICYmDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKG1wYXRoLT5mbGFncyAmIE1FU0hfUEFUSF9BQ1RJVkUpKSB7DQo+ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5ID0gdHJ1ZTsNCj4gQEAgLTQ0NywxNCArNDQ4 LDE1IEBAIHN0YXRpYyB2b2lkIGh3bXBfcHJlcV9mcmFtZV9wcm9jZXNzKHN0cnVjdCBpZWVlODAy MTFfc3ViX2lmX2RhdGEgKnNkYXRhLA0KPg0KPiAgICAgICBpZiAocmVwbHkpIHsNCj4gICAgICAg ICAgICAgICBsaWZldGltZSA9IFBSRVFfSUVfTElGRVRJTUUocHJlcV9lbGVtKTsNCj4gLSAgICAg ICAgICAgICB0dGwgPSBpZm1zaC0+bXNoY2ZnLmRvdDExTWVzaFRUTDsNCj4gLSAgICAgICAgICAg ICBpZiAodHRsICE9IDApDQo+ICsgICAgICAgICAgICAgdHRsID0gUFJFUV9JRV9UVEwocHJlcV9l bGVtKTsNCj4gKyAgICAgICAgICAgICBpZiAodHRsICE9IDApIHsNCj4gKyAgICAgICAgICAgICAg ICAgICAgIHR0bCA9IGlmbXNoLT5tc2hjZmcuZG90MTFNZXNoVFRMOw0KPiAgICAgICAgICAgICAg ICAgICAgICAgbWVzaF9wYXRoX3NlbF9mcmFtZV90eChNUEFUSF9QUkVQLCAwLCBkc3RfYWRkciwN Cj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIoZHN0X2RzbiksIDAs IG9yaWdfYWRkciwNCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIo b3JpZ19kc24pLCBtZ210LT5zYSwgMCwgdHRsLA0KPiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjcHVfdG9fbGUzMihsaWZldGltZSksIGNwdV90b19sZTMyKG1ldHJpYyksDQo+ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDAsIHNkYXRhKTsNCj4gLSAgICAgICAgICAgICBlbHNl DQo+ICsgICAgICAgICAgICAgfSBlbHNlDQo+ICAgICAgICAgICAgICAgICAgICAgICBpZm1zaC0+ bXNoc3RhdHMuZHJvcHBlZF9mcmFtZXNfdHRsKys7DQo+ICAgICAgIH0NCj4NCj4gZGlmZiAtLWdp dCBhL25ldC9tYWM4MDIxMS9tZXNoX3BsaW5rLmMgYi9uZXQvbWFjODAyMTEvbWVzaF9wbGluay5j DQo+IGluZGV4IGNiMTQyNTMuLmZmY2JhZDcgMTAwNjQ0DQo+IC0tLSBhL25ldC9tYWM4MDIxMS9t ZXNoX3BsaW5rLmMNCj4gKysrIGIvbmV0L21hYzgwMjExL21lc2hfcGxpbmsuYw0KPiBAQCAtNDA5 LDcgKzQwOSw3IEBAIHZvaWQgbWVzaF9yeF9wbGlua19mcmFtZShzdHJ1Y3QgaWVlZTgwMjExX3N1 Yl9pZl9kYXRhICpzZGF0YSwgc3RydWN0IGllZWU4MDIxMV9tDQo+ICAgICAgIGJhc2VsZW4gPSAo dTggKikgbWdtdC0+dS5hY3Rpb24udS5wbGlua19hY3Rpb24udmFyaWFibGUgLSAodTggKikgbWdt dDsNCj4gICAgICAgaWYgKG1nbXQtPnUuYWN0aW9uLnUucGxpbmtfYWN0aW9uLmFjdGlvbl9jb2Rl ID09IFBMSU5LX0NPTkZJUk0pIHsNCj4gICAgICAgICAgICAgICBiYXNlYWRkciArPSA0Ow0KPiAt ICAgICAgICAgICAgIGJhc2VsZW4gLT0gNDsNCj4gKyAgICAgICAgICAgICBiYXNlbGVuICs9IDQ7 DQo+ICAgICAgIH0NCj4gICAgICAgaWVlZTgwMl8xMV9wYXJzZV9lbGVtcyhiYXNlYWRkciwgbGVu IC0gYmFzZWxlbiwgJmVsZW1zKTsNCj4gICAgICAgaWYgKCFlbGVtcy5wZWVyX2xpbmspIHsNCg0K DQotLQ0KSm9obiBXLiBMaW52aWxsZSAgICAgICAgICAgICAgICBTb21lZGF5IHRoZSB3b3JsZCB3 aWxsIG5lZWQgYSBoZXJvLCBhbmQgeW91DQpsaW52aWxsZUB0dXhkcml2ZXIuY29tICAgICAgICAg ICAgICAgICAgbWlnaHQgYmUgYWxsIHdlIGhhdmUuICBCZSByZWFkeS4NCg0KDQotLS0tLS1QbGVh c2UgY29uc2lkZXIgdGhlIGVudmlyb25tZW50IGJlZm9yZSBwcmludGluZyB0aGlzIGUtbWFpbC4N Cg0KDQo= ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-11 11:47 ` david woo 2009-08-11 18:47 ` John W. Linville @ 2009-08-12 1:42 ` Javier Cardona 2009-08-12 6:39 ` david woo 1 sibling, 1 reply; 10+ messages in thread From: Javier Cardona @ 2009-08-12 1:42 UTC (permalink / raw) To: david woo; +Cc: Johannes Berg, linux-wireless, andrey, linville, devel David, Thanks for the patch. 2009/8/11 david woo <xinhua_wu@realsil.com.cn>: > [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 <xinhua_wu@realsil.com.cn> > --- > 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) > +{ nak > 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; This is a valid fix: at this point we should set the "destination sequence number" valid flag, not zero all flags. > } 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; Nak. The reply to a preq should have the locally configured TTL and not the TTL that was in the PREP. > 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; I'm confused with this. Could you actually establish plinks after changing this? Can you resubmit the patch with only the MESH_PATH_DSN_VALID for now? Thanks! Javier ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c 2009-08-12 1:42 ` Javier Cardona @ 2009-08-12 6:39 ` david woo 2009-08-12 18:03 ` Fix preq frame process and peer link frame baselen Javier Cardona 0 siblings, 1 reply; 10+ messages in thread From: david woo @ 2009-08-12 6:39 UTC (permalink / raw) To: Javier Cardona; +Cc: Johannes Berg, linux-wireless, andrey, linville, devel Javier, Thanks for your comments. Javier Cardona 写道: > David, > > Thanks for the patch. > > 2009/8/11 david woo <xinhua_wu@realsil.com.cn>: >> [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 <xinhua_wu@realsil.com.cn> >> --- >> 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) >> +{ > > nak > >> 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; > > This is a valid fix: at this point we should set the "destination > sequence number" valid flag, not zero all flags. > >> } 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; > > Nak. The reply to a preq should have the locally configured TTL and > not the TTL that was in the PREP. > Yes, I agree with you, and this patch is just to check whether this PREQ is valid with the ttl it contains instead of local TTL, and the local TTL has also been provided for PREP further process. >> 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; > > I'm confused with this. Could you actually establish plinks after > changing this? With the baseaddr steps with 4 bytes, while the baselen minus with 4 bytes, it's to avoid following element parser in random with last 8 bytes. ===> ieee802_11_parse_elems(baseaddr, len - baselen, &elems); baseaddr |<------------------->| baseaddr+4 |<--len - baselen->|<-4->|<-4->| (baselen -= 4) |<--len - baselen->| (baselen += 4) > > Can you resubmit the patch with only the MESH_PATH_DSN_VALID for now? > > Thanks! > > Javier > > > ------Please consider the environment before printing this e-mail. > > David ^ permalink raw reply [flat|nested] 10+ messages in thread
* Fix preq frame process and peer link frame baselen. 2009-08-12 6:39 ` david woo @ 2009-08-12 18:03 ` Javier Cardona 2009-08-12 18:03 ` [PATCH 1/2] mac80211: Mark a destination sequence number as valid when a PREQ is received Javier Cardona 0 siblings, 1 reply; 10+ messages in thread From: Javier Cardona @ 2009-08-12 18:03 UTC (permalink / raw) To: linux-wireless; +Cc: andrey, johannes, linville, devel, xinhua_wu > Yes, I agree with you, and this patch is just to check whether this PREQ is valid with > the ttl it contains instead of local TTL, and the local TTL has also been provided for > PREP further process. I'm still unconvinced with that change. The ttl check you refer to is done on transmission: PREQs with ttl of zero are never transmitted. See further down in that same function: ttl = PREQ_IE_TTL(preq_elem); lifetime = PREQ_IE_LIFETIME(preq_elem); if (ttl <= 1) { /* supress frame */ Furthermore, with the change you propose, you open the possibility for PREPs to be transmitted with ttl=0 (if ifmsh->mshcfg.dot11MeshTTL was set to zero). Regarding your baselen explanation, I now understand it and agree to the suggested change. Your initial patch submission was reversed and I got confused looking at two version of the same. I've created a new series with the parts of your patch that I agree with. They follow this e-mail. Thanks! Javier ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] mac80211: Mark a destination sequence number as valid when a PREQ is received. 2009-08-12 18:03 ` Fix preq frame process and peer link frame baselen Javier Cardona @ 2009-08-12 18:03 ` Javier Cardona 2009-08-12 18:03 ` [PATCH 2/2] mac80211: Fix invalid length passed to IE parser for PLINK CONFIRM frames Javier Cardona 0 siblings, 1 reply; 10+ messages in thread From: Javier Cardona @ 2009-08-12 18:03 UTC (permalink / raw) To: linux-wireless Cc: David Woo, Javier Cardona, andrey, johannes, linville, devel From: David Woo <xinhua_wu@realsil.com.cn> 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 <javier@cozybit.com> --- 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; -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] mac80211: Fix invalid length passed to IE parser for PLINK CONFIRM frames 2009-08-12 18:03 ` [PATCH 1/2] mac80211: Mark a destination sequence number as valid when a PREQ is received Javier Cardona @ 2009-08-12 18:03 ` Javier Cardona 0 siblings, 0 replies; 10+ messages in thread From: Javier Cardona @ 2009-08-12 18:03 UTC (permalink / raw) To: linux-wireless Cc: David Woo, Javier Cardona, andrey, johannes, linville, devel From: David Woo <xinhua_wu@realsil.com.cn> The length of the fixed portion of plink confirm frames is 4 bytes longer than the other plink_action frames. This path corrects an error in the length adjustment done for these type of frames. Signed-off-by: Javier Cardona <javier@cozybit.com> --- net/mac80211/mesh_plink.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 7c49c95..3575fe3 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -415,7 +415,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) { -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-08-12 18:15 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-08-11 10:22 diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c David Woo 2009-08-11 10:50 ` Johannes Berg 2009-08-11 11:47 ` david woo 2009-08-11 18:47 ` John W. Linville 2009-08-12 0:33 ` 吴新华 2009-08-12 1:42 ` Javier Cardona 2009-08-12 6:39 ` david woo 2009-08-12 18:03 ` Fix preq frame process and peer link frame baselen Javier Cardona 2009-08-12 18:03 ` [PATCH 1/2] mac80211: Mark a destination sequence number as valid when a PREQ is received Javier Cardona 2009-08-12 18:03 ` [PATCH 2/2] mac80211: Fix invalid length passed to IE parser for PLINK CONFIRM frames Javier Cardona
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).