diff options
author | Antonio Quartulli <antonio@open-mesh.com> | 2013-07-30 22:16:24 +0200 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-19 17:31:56 +0200 |
commit | a70a9aa990bdf24039cb4167993bcc5a0f9cbb18 (patch) | |
tree | 0e2cbae6d327c6a2a0904f0ba95dcbde914a3d47 /net/batman-adv/originator.c | |
parent | e75de4fa41d810113cf81f658a56e3972c7c12b4 (diff) |
batman-adv: lock around TT operations to avoid sending inconsistent data
A TT response may be prepared and sent while the local or
global translation table is getting updated.
The worst case is when one of the tables is accessed after
its content has been recently updated but the metadata
(TTVN/CRC) has not yet. In this case the reader will get a
table content which does not match the TTVN/CRC.
This will lead to an inconsistent state and so to a TT
recovery.
To avoid entering this situation, put a lock around those TT
operations recomputing the metadata and around the TT
Response creation (the latter is the only reader that
accesses the metadata together with the table).
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index a591dc5c321..867778e8184 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -239,6 +239,7 @@ struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv, spin_lock_init(&orig_node->bcast_seqno_lock); spin_lock_init(&orig_node->neigh_list_lock); spin_lock_init(&orig_node->tt_buff_lock); + spin_lock_init(&orig_node->tt_lock); batadv_nc_init_orig(orig_node); |