Currently the mesh sync code checks, whether peers indicate TBTT adjustment,
but it never sets the corresponding flag itself.
By setting ifmsh->tbtt_adjusting to true, it will set the corresponding field
in the mesh configuration IE of own beacons.
This indication will be set in the current beacon. The TBTT adjustment will be
performed afterwards, affecting the next beacon. Thus, the first beacon with
stable TBTT will not indicate adjustment anymore and peers will continue
tracking the new offset.
Signed-off-by: Marco Porsch <[email protected]>
---
net/mac80211/mesh_sync.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/mac80211/mesh_sync.c b/net/mac80211/mesh_sync.c
index 407c870..c0dc0a9 100644
--- a/net/mac80211/mesh_sync.c
+++ b/net/mac80211/mesh_sync.c
@@ -225,11 +225,15 @@ static void mesh_sync_offset_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
ifmsh->sync_offset_clockdrift_max);
set_bit(MESH_WORK_DRIFT_ADJUST,
&ifmsh->wrkq_flags);
+
+ ifmsh->adjusting_tbtt = true;
} else {
msync_dbg(sdata,
"TBTT : max clockdrift=%lld; too small to adjust\n",
(long long)ifmsh->sync_offset_clockdrift_max);
ifmsh->sync_offset_clockdrift_max = 0;
+
+ ifmsh->adjusting_tbtt = false;
}
spin_unlock_bh(&ifmsh->sync_offset_lock);
}
--
1.7.9.5
On Fri, 2012-11-23 at 12:23 -0800, Marco Porsch wrote:
> Currently the mesh sync code checks, whether peers indicate TBTT adjustment,
> but it never sets the corresponding flag itself.
>
> By setting ifmsh->tbtt_adjusting to true, it will set the corresponding field
> in the mesh configuration IE of own beacons.
> This indication will be set in the current beacon. The TBTT adjustment will be
> performed afterwards, affecting the next beacon. Thus, the first beacon with
> stable TBTT will not indicate adjustment anymore and peers will continue
> tracking the new offset.
Applied.
johannes
On Wed, Nov 28, 2012 at 5:08 AM, Johannes Berg
<[email protected]> wrote:
> On Fri, 2012-11-23 at 12:23 -0800, Marco Porsch wrote:
>> Currently the mesh sync code checks, whether peers indicate TBTT adjustment,
>> but it never sets the corresponding flag itself.
>>
>> By setting ifmsh->tbtt_adjusting to true, it will set the corresponding field
>> in the mesh configuration IE of own beacons.
>> This indication will be set in the current beacon. The TBTT adjustment will be
>> performed afterwards, affecting the next beacon. Thus, the first beacon with
>> stable TBTT will not indicate adjustment anymore and peers will continue
>> tracking the new offset.
>
> Ping mesh folks, does this look sane?
Looks fine. The only effect (as Marco mentioned) is that the
"adjusting tbtt" bit is advertised correctly in the mesh config IE.
Thomas
On Fri, 2012-11-23 at 12:23 -0800, Marco Porsch wrote:
> Currently the mesh sync code checks, whether peers indicate TBTT adjustment,
> but it never sets the corresponding flag itself.
>
> By setting ifmsh->tbtt_adjusting to true, it will set the corresponding field
> in the mesh configuration IE of own beacons.
> This indication will be set in the current beacon. The TBTT adjustment will be
> performed afterwards, affecting the next beacon. Thus, the first beacon with
> stable TBTT will not indicate adjustment anymore and peers will continue
> tracking the new offset.
Ping mesh folks, does this look sane?
johannes