SF.net SVN: gar:[26733] csw/mgar/pkg/nsd/trunk

idogan23 at users.sourceforge.net idogan23 at users.sourceforge.net
Tue Feb 9 10:39:31 CET 2021


Revision: 26733
          http://sourceforge.net/p/gar/code/26733
Author:   idogan23
Date:     2021-02-09 09:39:30 +0000 (Tue, 09 Feb 2021)
Log Message:
-----------
nsd: Fix ifaddrs.h compile error. https://github.com/NLnetLabs/nsd/commit/230d1951696a175ebeaf95fce53bb35d9af9fceb

Modified Paths:
--------------
    csw/mgar/pkg/nsd/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/nsd/trunk/files/0005-ifaddrs_nsd_c.patch

Modified: csw/mgar/pkg/nsd/trunk/Makefile
===================================================================
--- csw/mgar/pkg/nsd/trunk/Makefile	2021-02-08 19:15:24 UTC (rev 26732)
+++ csw/mgar/pkg/nsd/trunk/Makefile	2021-02-09 09:39:30 UTC (rev 26733)
@@ -34,6 +34,7 @@
 PATCHFILES += 0002-Fix-AF_LOCAL_remote_c.patch
 PATCHFILES += 0003-ifaddrs_configure_ac.patch
 PATCHFILES += 0004-ifaddrs_nsd_c.patch
+PATCHFILES += 0005-ifaddrs_nsd_c.patch
 
 SPKG_CLASSES = none cswusergroup ugfiles cswcpsampleconf cswinitsmf
 PROTOTYPE_FILTER = awk '$$$$3 ~ /\/init.d\/cswnsd$$$$/ { $$$$2 = "cswinitsmf" } $$$$3 ~ /\/CSWnsd\/cswusergroup$$$$/ { $$$$2 = "cswusergroup" } $$$$3 ~ /\/nsd\/nsd.conf.CSW$$$$/ { $$$$2 = "cswcpsampleconf" } $$$$3 ~ /\/var\/opt\/csw\/nsd/ { $$$$2 = "ugfiles" }  $$$$3 ~ /\/var\/opt\/csw\/nsd/ { $$$$5 = "nsd" } $$$$3 ~ /\/var\/opt\/csw\/nsd/ { $$$$6 = "nsd" } $$$$3 ~ /\/var\/run/ { $$$$6 = "sys" } { print }'

Added: csw/mgar/pkg/nsd/trunk/files/0005-ifaddrs_nsd_c.patch
===================================================================
--- csw/mgar/pkg/nsd/trunk/files/0005-ifaddrs_nsd_c.patch	                        (rev 0)
+++ csw/mgar/pkg/nsd/trunk/files/0005-ifaddrs_nsd_c.patch	2021-02-09 09:39:30 UTC (rev 26733)
@@ -0,0 +1,79 @@
+From 140dfd990fa681777fc05596b9b4bee88ea0ed26 Mon Sep 17 00:00:00 2001
+From: Ihsan Dogan <ihsan at opencsw.org>
+Date: Tue, 9 Feb 2021 10:27:28 +0100
+Subject: [PATCH] Fix ifaddrs compile error
+
+---
+ nsd.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/nsd.c b/nsd.c
+index 9ed3fbd..cb4b037 100644
+--- a/nsd.c
++++ b/nsd.c
+@@ -467,6 +467,7 @@ figure_default_sockets(
+ 	figure_socket_servers(&(*tcp)[i], NULL);
+ }
+ 
++#ifdef HAVE_GETIFADDRS
+ static int
+ find_device(
+ 	struct nsd_socket *sock,
+@@ -515,6 +516,7 @@ find_device(
+ 
+ 	return 0;
+ }
++#endif /* HAVE_GETIFADDRS */
+ 
+ static void
+ figure_sockets(
+@@ -526,7 +528,9 @@ figure_sockets(
+ 	size_t i = 0;
+ 	struct addrinfo ai = *hints;
+ 	struct ip_address_option *ip;
++#ifdef HAVE_GETIFADDRS
+ 	struct ifaddrs *ifa = NULL;
++#endif
+ 	int bind_device = 0;
+ 
+ 	if(!ips) {
+@@ -541,9 +545,11 @@ figure_sockets(
+ 		bind_device |= (ip->dev != 0);
+ 	}
+ 
++#ifdef HAVE_GETIFADDRS
+ 	if(bind_device && getifaddrs(&ifa) == -1) {
+ 		error("getifaddrs failed: %s", strerror(errno));
+ 	}
++#endif
+ 
+ 	*udp = xalloc_zero((*ifs + 1) * sizeof(struct nsd_socket));
+ 	*tcp = xalloc_zero((*ifs + 1) * sizeof(struct nsd_socket));
+@@ -562,6 +568,7 @@ figure_sockets(
+ 			(*udp)[i].fib = ip->fib;
+ 			(*tcp)[i].fib = ip->fib;
+ 		}
++#ifdef HAVE_GETIFADDRS
+ 		if(ip->dev != 0) {
+ 			(*udp)[i].flags |= NSD_BIND_DEVICE;
+ 			(*tcp)[i].flags |= NSD_BIND_DEVICE;
+@@ -572,13 +579,16 @@ figure_sockets(
+ 				      ip->address);
+ 			}
+ 		}
++#endif
+ 	}
+ 
+ 	assert(i == *ifs);
+ 
++#ifdef HAVE_GETIFADDRS
+ 	if(ifa != NULL) {
+ 		freeifaddrs(ifa);
+ 	}
++#endif
+ }
+ 
+ /* print server affinity for given socket. "*" if socket has no affinity with
+-- 
+2.4.0
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list