summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2016-10-05 16:05:34 +0300
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-05 14:56:04 +0000
commit4beb30c0b3c2aace82b2b3c8c8e8588192ef6436 (patch)
tree1863b338e9867f53727c592f2423e9717198493e /vnet
parentdb6498848126839010eaad0bc79571a9ccbfc1bc (diff)
Fix LISP map-request resend deadlock
Change-Id: I2cc57079741279669241b88d0317853e1312e8c5 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/lisp-cp/control.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/vnet/vnet/lisp-cp/control.c b/vnet/vnet/lisp-cp/control.c
index 579f4f3aca7..166c5337836 100644
--- a/vnet/vnet/lisp-cp/control.c
+++ b/vnet/vnet/lisp-cp/control.c
@@ -3562,14 +3562,17 @@ send_map_request_thread_fn (void *arg)
map_request_args_t *a = arg;
lisp_cp_main_t *lcm = vnet_lisp_cp_get_main ();
- lisp_pending_map_request_lock (lcm);
-
if (a->is_resend)
+ /* if resending, we already have the lock */
resend_encapsulated_map_request (lcm, &a->seid, &a->deid, a->smr_invoked);
else
- send_encapsulated_map_request (lcm, &a->seid, &a->deid, a->smr_invoked);
+ {
+ /* get lock before sending map-request */
+ lisp_pending_map_request_lock (lcm);
+ send_encapsulated_map_request (lcm, &a->seid, &a->deid, a->smr_invoked);
+ lisp_pending_map_request_unlock (lcm);
+ }
- lisp_pending_map_request_unlock (lcm);
return 0;
}