From 9e7a548ce421660b0d22bfeb90c2b2b53742aac7 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 22 May 2012 14:32:22 +0200 Subject: build: allow configure and build in a separate directory Some .h files in lib/ are autogenerated. The search path should include the build directory and the source directory. They usually match but sometimes, they may be different. For example: $ mkdir build $ cd build $ ../configure $ make --- zebra/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zebra') diff --git a/zebra/Makefile.am b/zebra/Makefile.am index 542f36f4..e5b749a6 100644 --- a/zebra/Makefile.am +++ b/zebra/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. -INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @SNMP_INCLUDES@ +INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib @SNMP_INCLUDES@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@ INSTALL_SDATA=@INSTALL@ -m 600 -- cgit v1.2.1 From 6b1e37f8537fa2a4560de32e83ca5089763e2d39 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 22 May 2012 22:15:20 +0200 Subject: build: only define HAVE_SNMP NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols. --- zebra/zebra_snmp.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'zebra') diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index 0fde4bb8..3dbfb587 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -22,14 +22,8 @@ #include #ifdef HAVE_SNMP -#ifdef HAVE_NETSNMP #include #include -#else -#include -#include -#include -#endif #include "if.h" #include "log.h" -- cgit v1.2.1 From 08d7f6533ecc0f935a76918c462982004534864d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 22 May 2012 22:29:17 +0200 Subject: build: use net-snmp-config to configure NetSNMP The correct method to link to NetSNMP is to use net-snmp-config (which is like pkg-config). Explicit link to libcrypto is also dropped (NetSNMP libs are linked to libcrypto, no need to link Quagga to it). Moreover, @SNMP_INCLUDES@ is dropped because useless. Due to a bug in configure.ac, it was properly populated. --- zebra/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zebra') diff --git a/zebra/Makefile.am b/zebra/Makefile.am index e5b749a6..9ac90f8e 100644 --- a/zebra/Makefile.am +++ b/zebra/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in. -INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib @SNMP_INCLUDES@ +INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@ INSTALL_SDATA=@INSTALL@ -m 600 -- cgit v1.2.1 From 8046ba6ec4d6e87bf8da6563c0f3e5e66c4652b3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 31 May 2012 13:30:28 +0200 Subject: snmp: let handlers accept OID from a lesser prefix Most table handlers do not expect to be given an OID whose prefix is outside what they can handle. This is not a problem with the SMUX implementation since it always correct the OID such that the prefix matches. However, this is not the case for the AgentX implementation. A new function, smux_header_table() is used to do this normalization. --- zebra/zebra_snmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'zebra') diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c index 3dbfb587..f52bbcb8 100644 --- a/zebra/zebra_snmp.c +++ b/zebra/zebra_snmp.c @@ -451,6 +451,10 @@ ipFwTable (struct variable *v, oid objid[], size_t *objid_len, static struct in_addr netmask; struct nexthop *nexthop; + if (smux_header_table(v, objid, objid_len, exact, val_len, write_method) + == MATCH_FAILED) + return NULL; + get_fwtable_route_node(v, objid, objid_len, exact, &np, &rib); if (!np) return NULL; @@ -549,6 +553,10 @@ static u_char * ipCidrTable (struct variable *v, oid objid[], size_t *objid_len, int exact, size_t *val_len, WriteMethod **write_method) { + if (smux_header_table(v, objid, objid_len, exact, val_len, write_method) + == MATCH_FAILED) + return NULL; + switch (v->magic) { case IPCIDRROUTEDEST: -- cgit v1.2.1