diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-11-25 13:51:33 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-11-25 18:58:46 +0000 |
commit | 0a2fde105a5a0c996333d67d2901b4eaedf7cbe1 (patch) | |
tree | 50f88e5df90ebc47c21ca5752eec2d4abf20f124 /src/vnet/syslog/syslog.c | |
parent | 9404a077a044264bae9c71fafc57bf5a894758f3 (diff) |
syslog: use per-thread vlib_main
We should not use main thread vlib_main in workers.
Type: fix
Change-Id: I58c0a8cadf2dc7f768b20ac90e7ec7921e2e8ca4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/syslog/syslog.c')
-rw-r--r-- | src/vnet/syslog/syslog.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/syslog/syslog.c b/src/vnet/syslog/syslog.c index f05ce8dc5ff..20728b8a17a 100644 --- a/src/vnet/syslog/syslog.c +++ b/src/vnet/syslog/syslog.c @@ -143,8 +143,7 @@ void syslog_msg_init (syslog_msg_t * syslog_msg, syslog_facility_t facility, syslog_severity_t severity, char *app_name, char *msgid) { - syslog_main_t *sm = &syslog_main; - vlib_main_t *vm = sm->vlib_main; + vlib_main_t *vm = vlib_get_main (); syslog_msg->header.facility = facility; syslog_msg->header.severity = severity; @@ -160,7 +159,7 @@ int syslog_msg_send (syslog_msg_t * syslog_msg) { syslog_main_t *sm = &syslog_main; - vlib_main_t *vm = sm->vlib_main; + vlib_main_t *vm = vlib_get_main (); u32 bi, msg_len, *to_next; u8 *tmp; vlib_buffer_t *b; @@ -611,7 +610,6 @@ syslog_init (vlib_main_t * vm) struct timeval timeval_0; vlib_node_t *ip4_lookup_node; - sm->vlib_main = vm; sm->vnet_main = vnet_get_main (); sm->procid = getpid (); |