]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: lock around TT operations to avoid sending inconsistent data
authorAntonio Quartulli <antonio@open-mesh.com>
Tue, 30 Jul 2013 20:16:24 +0000 (22:16 +0200)
committerAntonio Quartulli <antonio@meshcoding.com>
Sat, 19 Oct 2013 15:31:56 +0000 (17:31 +0200)
commitaa6cdea718d74fee7ab0416f3b7478e4b9f51833
tree0e2cbae6d327c6a2a0904f0ba95dcbde914a3d47
parentb249f7e2f383df7338b0ae16025b2306ea0b0239
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>
net/batman-adv/main.c
net/batman-adv/originator.c
net/batman-adv/translation-table.c
net/batman-adv/types.h