NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52945 (snmpd does not work under current 8.0_BETA)



The problem is portablity of net-snmpd.

>configure:29616: checking for IP_PKTINFO 
...
>conftest.c: In function 'main':
>conftest.c:380:31: error: 'SOL_IP' undeclared (first use in this function)
>         if (cm->cmsg_level == SOL_IP && cm->cmsg_type == IP_PKTINFO) {
>                               ^
>conftest.c:380:31: note: each undeclared identifier is reported only once for each function it appears in
>conftest.c:382:48: warning: implicit declaration of function 'inet_ntoa' [-Wimplicit-function-declaration]
>             printf("Address: %s; index: %d\n", inet_ntoa(src->ipi_addr),
>                                                ^
>configure:29668: $? = 1

it seems that configure cannot detect IP_PKTINFO correctly
because of using SOL_IP. SOL_IP is not defined on *BSD.
And on netbsd, struct ip_pktinfo has no ipi_spec_dst.

Please test following patch?


Index: net/net-snmp/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/net-snmp/Makefile,v
retrieving revision 1.121
diff -a -u -r1.121 Makefile
--- net/net-snmp/Makefile	6 Oct 2017 02:39:38 -0000	1.121
+++ net/net-snmp/Makefile	15 Feb 2018 12:15:21 -0000
@@ -30,6 +30,7 @@
 .  if empty(CFLAGS:U:M*-Dnetbsd1*)
 CFLAGS+=		-Dnetbsd1
 .  endif
+CFLAGS+=		-DSOL_IP=IPPROTO_IP
 .endif
 
 .if (${OPSYS} == "NetBSD") || !exists(/usr/bin/lpstat)
Index: net/net-snmp/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/net-snmp/distinfo,v
retrieving revision 1.91
diff -a -u -r1.91 distinfo
--- net/net-snmp/distinfo	6 Oct 2017 02:39:38 -0000	1.91
+++ net/net-snmp/distinfo	15 Feb 2018 12:15:21 -0000
@@ -54,3 +54,4 @@
 SHA1 (patch-perl_default__store_Makefile.PL) = ed5ad7385680632b2153fa572635c5aea83c9114
 SHA1 (patch-perl_manager_Makefile.PL) = bb34b119a2b3887a1af1f9b88e6d4bad6baf60bb
 SHA1 (patch-snmplib_snmp__api.c) = b4f498aa93b61f809e3696df1fc6bf32bd942233
+SHA1 (patch-snmplib_transports_snmpUDPBaseDomain.c) = b0fd8536f71761d115a93110cf45984f0bff2387
Index: net/net-snmp/patches/patch-snmplib_transports_snmpUDPBaseDomain.c
===================================================================
RCS file: net/net-snmp/patches/patch-snmplib_transports_snmpUDPBaseDomain.c
diff -N net/net-snmp/patches/patch-snmplib_transports_snmpUDPBaseDomain.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ net/net-snmp/patches/patch-snmplib_transports_snmpUDPBaseDomain.c	15 Feb 2018 12:15:21 -0000
@@ -0,0 +1,20 @@
+--- snmplib/transports/snmpUDPBaseDomain.c.orig	2014-12-08 20:23:22.000000000 +0000
++++ snmplib/transports/snmpUDPBaseDomain.c
+@@ -277,7 +277,7 @@ int netsnmp_udpbase_sendto(int fd, struc
+              * come from.
+              */
+             ipi.ipi_ifindex = 0;
+-#if defined(cygwin)
++#if defined(cygwin) || defined(__NetBSD__)
+             ipi.ipi_addr.s_addr = srcip->s_addr;
+ #else
+             ipi.ipi_spec_dst.s_addr = srcip->s_addr;
+@@ -302,7 +302,7 @@ int netsnmp_udpbase_sendto(int fd, struc
+ 
+             memset(&ipi, 0, sizeof(ipi));
+             ipi.ipi_ifindex = if_index;
+-#if defined(cygwin)
++#if defined(cygwin) || defined(__NetBSD__)
+             ipi.ipi_addr.s_addr = INADDR_ANY;
+ #else
+             ipi.ipi_spec_dst.s_addr = INADDR_ANY;



-- 
ryo shimizu


Home | Main Index | Thread Index | Old Index