diff options
Diffstat (limited to 'src/vnet/udp/udp.c')
-rw-r--r-- | src/vnet/udp/udp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c index c12e837a74a..70091655211 100644 --- a/src/vnet/udp/udp.c +++ b/src/vnet/udp/udp.c @@ -334,6 +334,7 @@ udp_init (vlib_main_t * vm) u32 num_threads; clib_error_t *error = 0; ip_protocol_info_t *pi; + int i; if ((error = vlib_call_init_function (vm, ip_main_init))) return error; @@ -367,6 +368,13 @@ udp_init (vlib_main_t * vm) vec_validate (um->connection_peekers, num_threads - 1); vec_validate (um->peekers_readers_locks, num_threads - 1); vec_validate (um->peekers_write_locks, num_threads - 1); + + if (num_threads > 1) + for (i = 0; i < num_threads; i++) + { + clib_spinlock_init (&um->peekers_readers_locks[i]); + clib_spinlock_init (&um->peekers_write_locks[i]); + } return error; } |