route-table: Make route-table module thread-safe.
authorRyan Wilson <wryan@nicira.com>
Thu, 29 May 2014 21:56:09 +0000 (14:56 -0700)
committerAlex Wang <alexw@nicira.com>
Thu, 29 May 2014 21:59:37 +0000 (14:59 -0700)
commit3c27dbe6b71e36c0d05e8299e811615697fc1bc0
treee72e6449e1d84a93e128b639a65f13e17c905aa3
parent6c5b90cebfea8bb88c589c76e20e7195b0c859bf
route-table: Make route-table module thread-safe.

Due to patch fe83f8 (netdev: Remove netdev from global shash when
the user is changing interface configuration), netdevs can be
destructed and deallocated by revalidator and RCU threads. When
netdevs with class vport are destroyed, the routing table is
unregistered, possibly causing memory to be freed. This causes a
race condition with the main thread which calls route_table_run
periodically to check for routing table updates.

This patch makes the route-table module thread-safe via a mutex.

Bug #1258532
Signed-off-by: Ryan Wilson <wryan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
lib/route-table-stub.c
lib/route-table.c
lib/route-table.h