From 9fbf5a400444c4841dcecf6c4d0a73dfc22c2161 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 8 Mar 2016 22:08:34 +0100 Subject: [PATCH] SNMP: Support LWIP_TCPIP_CORE_LOCKING sync method --- src/apps/snmp/snmp_mib2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apps/snmp/snmp_mib2.c b/src/apps/snmp/snmp_mib2.c index 6aab86ca..5fccf1e0 100644 --- a/src/apps/snmp/snmp_mib2.c +++ b/src/apps/snmp/snmp_mib2.c @@ -91,10 +91,17 @@ netif_to_num(const struct netif *netif) #if SNMP_USE_NETCONN #include "lwip/tcpip.h" +#include "lwip/priv/tcpip_priv.h" void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg) { +#if LWIP_TCPIP_CORE_LOCKING + LOCK_TCPIP_CORE(); + fn(arg); + UNLOCK_TCPIP_CORE(); +#else tcpip_callback_with_block(fn, arg, 1); +#endif } struct snmp_threadsync_instance snmp_mib2_lwip_locks;