summaryrefslogtreecommitdiff
path: root/cesar/bsu/src
diff options
context:
space:
mode:
authorNélio Laranjeiro2011-03-15 16:25:18 +0100
committerNélio Laranjeiro2011-03-15 17:12:38 +0100
commit0c4b0dac6040f36507026ac12891bc09921e5b09 (patch)
tree8c28c4645b01791688a09908e7a0425d8316c447 /cesar/bsu/src
parent7ae842f5334731fccb674fe8e4e4764ec0f52dd6 (diff)
cesar/bsu: save sta_avln when positioned after the removed avln, closes #2399
bsu_avln_remove corrupts the sta_avln pointer when it removes the AVLN in positions before in the table.
Diffstat (limited to 'cesar/bsu/src')
-rw-r--r--cesar/bsu/src/bsu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cesar/bsu/src/bsu.c b/cesar/bsu/src/bsu.c
index 50893eb929..03ef287843 100644
--- a/cesar/bsu/src/bsu.c
+++ b/cesar/bsu/src/bsu.c
@@ -247,10 +247,15 @@ bsu_avln_remove (u64 nid, u8 snid, mac_t mac)
}
if (to_remove)
{
+ /* Station's AVLN is the removed one. */
if (to_remove == ctx->sta_avln)
bsu_track_avln_identify (ctx, NULL);
for (i = pos; i < ctx->avlns_nb - 1; i++)
+ {
+ if (ctx->sta_avln == &ctx->avlns[i+1])
+ ctx->sta_avln = &ctx->avlns[i];
ctx->avlns[i] = ctx->avlns[i+1];
+ }
ctx->avlns_nb--;
}
}