aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-11-25 13:51:33 +0100
committerDamjan Marion <dmarion@me.com>2020-11-25 18:58:46 +0000
commit0a2fde105a5a0c996333d67d2901b4eaedf7cbe1 (patch)
tree50f88e5df90ebc47c21ca5752eec2d4abf20f124
parent9404a077a044264bae9c71fafc57bf5a894758f3 (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>
-rw-r--r--src/vnet/syslog/syslog.c6
-rw-r--r--src/vnet/syslog/syslog.h1
2 files changed, 2 insertions, 5 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 ();
diff --git a/src/vnet/syslog/syslog.h b/src/vnet/syslog/syslog.h
index 4809af48e97..3ec1cb35f35 100644
--- a/src/vnet/syslog/syslog.h
+++ b/src/vnet/syslog/syslog.h
@@ -136,7 +136,6 @@ typedef struct
u32 ip4_lookup_node_index;
/** convenience variables */
- vlib_main_t *vlib_main;
vnet_main_t *vnet_main;
} syslog_main_t;