Bug#387665: [pkg-ntp-maintainers] Bug#387665: ntp: mismatching ifdefs for IPv6 + POSIXness issue => FTBFS on Hurd

Kurt Roeckx kurt at roeckx.be
Mon Sep 18 18:21:28 UTC 2006


On Mon, Sep 18, 2006 at 05:29:16PM +0200, Marc Dequènes wrote:
> Kurt Roeckx <kurt at roeckx.be> writes:
> 
> > NI_MAXHOST really is a better thing to use there, so this looks good.
> 
> Yes, this is not a Hurd-specific patch at all, this would probably have
> caused problems on other systems.
> 
> Thanks for the review :-).

So, does the attached patch work for you?


Kurt

-------------- next part --------------
--- ntp-4.2.2.orig/libisc/net.c
+++ ntp-4.2.2/libisc/net.c
@@ -206,7 +206,6 @@
 	RUNTIME_CHECK(isc_once_do(&once_ipv6only,
 				  try_ipv6only) == ISC_R_SUCCESS);
 }
-#endif /* IPV6_V6ONLY */
 
 static void
 try_ipv6pktinfo(void) {
@@ -257,6 +256,7 @@
 				  try_ipv6pktinfo) == ISC_R_SUCCESS);
 }
 #endif /* WANT_IPV6 */
+#endif /* ISC_PLATFORM_HAVEIPV6 */
 
 isc_result_t
 isc_net_probe_ipv6only(void) {
--- ntp-4.2.2.orig/ntpd/ntp_intres.c
+++ ntp-4.2.2/ntpd/ntp_intres.c
@@ -524,10 +524,10 @@
 			msyslog(LOG_INFO, "findhostaddr: Resolving %s>",
 				stoa(&entry->peer_store));
 #endif
-		entry->ce_name = emalloc(MAXHOSTNAMELEN);
+		entry->ce_name = emalloc(NI_MAXHOST);
 		error = getnameinfo((const struct sockaddr *)&entry->peer_store,
 				   SOCKLEN(&entry->peer_store),
-				   (char *)&entry->ce_name, MAXHOSTNAMELEN,
+				   (char *)&entry->ce_name, NI_MAXHOST,
 				   NULL, 0, 0);
 	}
 #ifdef DEBUG


More information about the pkg-ntp-maintainers mailing list