nat: use correct per-thread vlib_main

Using vlib_main of another thread is prohibited.

Type: fix

Change-Id: I9a85a5fee5c6665d423b4306faf3b3f2c5e22f99
Signed-off-by: Benoît Ganne <bganne@cisco.com>
diff --git a/src/plugins/nat/lib/ipfix_logging.c b/src/plugins/nat/lib/ipfix_logging.c
index f664585..2fb8912 100644
--- a/src/plugins/nat/lib/ipfix_logging.c
+++ b/src/plugins/nat/lib/ipfix_logging.c
@@ -544,7 +544,7 @@
   ipfix_set_header_t *s = 0;
   ip4_header_t *ip;
   udp_header_t *udp;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
 
   tp = vlib_buffer_get_current (b0);
   ip = (ip4_header_t *) & tp->ip4;
@@ -588,7 +588,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u8 proto;
   u16 template_id;
@@ -692,7 +692,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u8 nat_event = NAT_ADDRESSES_EXHAUTED;
   u16 template_id;
@@ -777,7 +777,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u8 nat_event = QUOTA_EXCEEDED;
   u32 quota_event = MAX_ENTRIES_PER_USER;
@@ -868,7 +868,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u8 nat_event = QUOTA_EXCEEDED;
   u32 quota_event = MAX_SESSION_ENTRIES;
@@ -956,7 +956,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u8 nat_event = QUOTA_EXCEEDED;
   u32 quota_event = MAX_BIB_ENTRIES;
@@ -1047,7 +1047,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u16 template_id;
 
@@ -1151,7 +1151,7 @@
   vlib_buffer_t *b0 = 0;
   u32 bi0 = ~0;
   u32 offset;
-  vlib_main_t *vm = vlib_mains[thread_index];
+  vlib_main_t *vm = vlib_get_main ();
   u64 now;
   u16 template_id;