diff options
author | tron <tron> | 1999-08-15 11:07:13 +0000 |
---|---|---|
committer | tron <tron> | 1999-08-15 11:07:13 +0000 |
commit | e8a1139c5cdd1b7640af4e24215da6277b2d8e72 (patch) | |
tree | 3201d06ff7266754b946087133e5917352d7a29c /net | |
parent | 99cc56b399b35fe4cc6ca5f83ad443ae582e2c43 (diff) | |
download | pkgsrc-e8a1139c5cdd1b7640af4e24215da6277b2d8e72.tar.gz |
Fix "ucd-snmpd" to return "mib-2.ip.ipAddrTable" and make sure "netbsd1"
preprocessor symbol gets defined on NetBSD systems.
Patches supplied by Zdenek Salvet in PR pkg/7799.
Diffstat (limited to 'net')
-rw-r--r-- | net/ucd-snmp/Makefile | 8 | ||||
-rw-r--r-- | net/ucd-snmp/files/patch-sum | 4 | ||||
-rw-r--r-- | net/ucd-snmp/patches/patch-af | 46 | ||||
-rw-r--r-- | net/ucd-snmp/patches/patch-ag | 29 |
4 files changed, 85 insertions, 2 deletions
diff --git a/net/ucd-snmp/Makefile b/net/ucd-snmp/Makefile index 7684ba79bde..530537dd7da 100644 --- a/net/ucd-snmp/Makefile +++ b/net/ucd-snmp/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 1999/08/15 09:44:00 tron Exp $ +# $NetBSD: Makefile,v 1.14 1999/08/15 11:07:13 tron Exp $ # FreeBSD Id: Makefile,v 1.18 1998/04/06 20:50:31 andreas Exp # @@ -29,4 +29,10 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/etc/* ${PREFIX}/share/examples/ucd-snmp ${INSTALL_DATA_DIR} ${PREFIX}/lib/snmp/dlmod +.include "../../mk/bsd.prefs.mk" + +.if (${OPSYS} == "NetBSD") +CFLAGS+= -Dnetbsd1 +.endif + .include "../../mk/bsd.pkg.mk" diff --git a/net/ucd-snmp/files/patch-sum b/net/ucd-snmp/files/patch-sum index c64acbd8fb4..eccb2abcf5a 100644 --- a/net/ucd-snmp/files/patch-sum +++ b/net/ucd-snmp/files/patch-sum @@ -1,7 +1,9 @@ -$NetBSD: patch-sum,v 1.3 1999/08/15 10:12:51 tron Exp $ +$NetBSD: patch-sum,v 1.4 1999/08/15 11:07:14 tron Exp $ MD5 (patch-aa) = c681fd865ec75d7a09ecc55630381e5d MD5 (patch-ab) = a690180421173141cfa23c55630bbdb9 MD5 (patch-ac) = 9abe56a6a7600da8725526c9aa3cf9ff MD5 (patch-ad) = 528264880b88988e2febf0e5cf96e60b MD5 (patch-ae) = 7506a27cc308c926396420830c5274fe +MD5 (patch-af) = dbe74f9fd37bd9ab3d0e75ebf884866e +MD5 (patch-ag) = b128565e3df18c11d1e88f4a631ac4fa diff --git a/net/ucd-snmp/patches/patch-af b/net/ucd-snmp/patches/patch-af new file mode 100644 index 00000000000..e09f76d18e8 --- /dev/null +++ b/net/ucd-snmp/patches/patch-af @@ -0,0 +1,46 @@ +$NetBSD: patch-af,v 1.1 1999/08/15 11:07:14 tron Exp $ + +--- agent/mibgroup/mibII/interfaces.c.orig Tue Mar 16 00:46:12 1999 ++++ agent/mibgroup/mibII/interfaces.c Thu Jun 17 10:21:06 1999 +@@ -114,7 +114,7 @@ + + #if HAVE_SYS_SYSCTL_H + #include <sys/sysctl.h> +-# if defined(CTL_NET) && !defined(freebsd2) ++# if defined(CTL_NET) && !defined(freebsd2) && !defined(netbsd1) + # ifdef PF_ROUTE + # ifdef NET_RT_IFLIST + # define USE_SYSCTL_IFLIST +@@ -1462,16 +1462,31 @@ + cp = strchr(saveName, '\0'); + string_append_int (cp, ifnet.if_unit); + #endif +- if (1 || strcmp(saveName,"lo0") != 0) { /* XXX */ ++ if (1) { /* XXX */ + /* + * Try to find an address for this interface + */ + + auto_nlist(IFADDR_SYMBOL, (char *)&ia, sizeof(ia)); ++#ifdef netbsd1 ++ ia=(struct in_ifaddr *)ifnet.if_addrlist.tqh_first; ++#endif + while (ia) { + klookup((unsigned long)ia , (char *)&in_ifaddr, sizeof(in_ifaddr)); ++#ifdef netbsd1 ++#define CP(x) ((char *)(x)) ++{ char *cp; struct sockaddr * sa; ++ cp = (CP(in_ifaddr.ia_ifa.ifa_addr) - CP(ia)) + ++ CP(&in_ifaddr); sa = (struct sockaddr *)cp; ++if (sa->sa_family==AF_INET) ++#endif + if (in_ifaddr.ia_ifp == ifnetaddr) break; ++} ++#ifdef netbsd1 ++ ia=(struct in_ifaddr *)in_ifaddr.ia_ifa.ifa_list.tqe_next; ++#else + ia = in_ifaddr.ia_next; ++#endif + } + + #if !defined(netbsd1) && !defined(freebsd2) && !defined(openbsd2) && !defined(STRUCT_IFNET_HAS_IF_ADDRLIST) diff --git a/net/ucd-snmp/patches/patch-ag b/net/ucd-snmp/patches/patch-ag new file mode 100644 index 00000000000..3eb94bc7675 --- /dev/null +++ b/net/ucd-snmp/patches/patch-ag @@ -0,0 +1,29 @@ +$NetBSD: patch-ag,v 1.1 1999/08/15 11:07:14 tron Exp $ + + +--- agent/mibgroup/mibII/ip.c.orig Fri Mar 12 18:15:05 1999 ++++ agent/mibgroup/mibII/ip.c Thu Jun 17 10:08:11 1999 +@@ -728,7 +728,11 @@ + #ifdef linux + return (u_char *)&((struct sockaddr_in *)&lowin_ifnet.ia_subnetmask)->sin_addr.s_addr; + #else ++#ifdef netbsd1 ++ long_return = lowin_ifaddr.ia_subnetmask; ++#else + long_return = ntohl(lowin_ifaddr.ia_subnetmask); ++#endif + return(u_char *) &long_return; + #endif + #endif +@@ -737,7 +741,11 @@ + #if defined(linux) || defined(sunV3) + long_return = ntohl(((struct sockaddr_in *) &lowin_ifnet.ifu_broadaddr)->sin_addr.s_addr) & 1; + #else ++#ifdef netbsd1 ++ long_return = (((struct sockaddr_in *) &lowin_ifaddr.ia_broadaddr)->sin_addr.s_addr) & 1; ++#else + long_return = ntohl(((struct sockaddr_in *) &lowin_ifaddr.ia_broadaddr)->sin_addr.s_addr) & 1; ++#endif + #endif + return(u_char *) &long_return; + case IPADREASMMAX: |