From d11f748b30d6867e13a77ed83666cb34881a2f53 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 27 Jul 2016 19:39:44 +0200 Subject: [PATCH] *: fixup snmp support - HAVE_POLL is overloaded by net-snmp - missing includes - ospf6_snmp converted to vrf_iflist() Signed-off-by: David Lamparter --- lib/agentx.c | 1 + lib/thread.c | 12 ++++++++++++ ospf6d/ospf6_snmp.c | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/agentx.c b/lib/agentx.c index bb95903adf..9dc5b47de3 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -27,6 +27,7 @@ #include "command.h" #include "smux.h" +#include "memory.h" int agentx_enabled = 0; diff --git a/lib/thread.c b/lib/thread.c index 8d75509b1d..a8ccb8b3d0 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -33,11 +33,23 @@ #include "sigevent.h" #if defined HAVE_SNMP && defined SNMP_AGENTX + +#ifdef HAVE_POLL +#define QUAGGA_HAVE_POLL +#endif + #include #include #include #include +#ifdef HAVE_POLL +#undef HAVE_POLL +#endif +#ifdef QUAGGA_HAVE_POLL +#define HAVE_POLL +#endif + extern int agentx_enabled; #endif diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 307d420ece..7423a3733a 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -29,6 +29,8 @@ #include "log.h" #include "vty.h" #include "linklist.h" +#include "vector.h" +#include "vrf.h" #include "smux.h" #include "ospf6_proto.h" @@ -749,7 +751,7 @@ ospfv3WwLsdbEntry (struct variable *v, oid *name, size_t *length, ifslist = list_new (); if (!ifslist) return NULL; ifslist->cmp = (int (*)(void *, void *))if_icmp_func; - for (ALL_LIST_ELEMENTS_RO (iflist, node, iif)) + for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, iif)) listnode_add_sort (ifslist, iif); for (ALL_LIST_ELEMENTS_RO (ifslist, node, iif)) @@ -887,7 +889,7 @@ ospfv3IfEntry (struct variable *v, oid *name, size_t *length, ifslist = list_new (); if (!ifslist) return NULL; ifslist->cmp = (int (*)(void *, void *))if_icmp_func; - for (ALL_LIST_ELEMENTS_RO (iflist, i, iif)) + for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), i, iif)) listnode_add_sort (ifslist, iif); for (ALL_LIST_ELEMENTS_RO (ifslist, i, iif)) @@ -1047,7 +1049,7 @@ ospfv3NbrEntry (struct variable *v, oid *name, size_t *length, ifslist = list_new (); if (!ifslist) return NULL; ifslist->cmp = (int (*)(void *, void *))if_icmp_func; - for (ALL_LIST_ELEMENTS_RO (iflist, i, iif)) + for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), i, iif)) listnode_add_sort (ifslist, iif); for (ALL_LIST_ELEMENTS_RO (ifslist, i, iif)) -- 2.39.5