Index: head/net/chrony/Makefile =================================================================== --- head/net/chrony/Makefile (revision 488566) +++ head/net/chrony/Makefile (revision 488567) @@ -1,71 +1,72 @@ # Created by: Masaki TAGAWA # $FreeBSD$ PORTNAME= chrony PORTVERSION= 3.4 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://download.tuxfamily.org/chrony/ MAINTAINER= yonas@fizk.net COMMENT= System clock synchronization client and server LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING USERS= chronyd GROUPS= chronyd USES= cpe gmake libedit CPE_VENDOR= tuxfamily HAS_CONFIGURE= yes CONFIGURE_ARGS= --prefix=${PREFIX} \ --chronyvardir=/var/db/${PORTNAME} \ --sysconfdir=${PREFIX}/etc --mandir=${MANPREFIX}/man \ --datarootdir=${DATADIR} --docdir=${DOCSDIR} \ --with-readline-library=${LOCALBASE}/lib \ --with-user=chronyd --without-tomcrypt USE_RC_SUBR= chronyd ALL_TARGET= all INSTALL_TARGET= install PORTDOCS= FAQ NEWS README PORTEXAMPLES= chrony.conf.example1 chrony.conf.example2 \ chrony.conf.example3 chrony.keys.example # XXX: there are also other potentially useful options worth looking into: # --disable-pps Disable PPS API support OPTIONS_DEFINE= DOCS EXAMPLES IPV6 NETTLE NSS OPTIONS_DEFAULT= NETTLE NETTLE_DESC= Nettle crypto library support NSS_DESC= Add support for more hashing algorithms IPV6_CATEGORIES= ipv6 IPV6_CONFIGURE_OFF= --disable-ipv6 NETTLE_CONFIGURE_OFF= --without-nettle NETTLE_LIB_DEPENDS= libnettle.so:security/nettle NSS_BROKEN= Crashes on startup with NSS. See https://bugs.freebsd.org/223840 NSS_CONFIGURE_OFF= --without-nss NSS_LIB_DEPENDS= libfreebl3.so:security/nss NSS_USES= pkgconfig post-patch: @cd ${WRKSRC}/examples && \ ${REINPLACE_CMD} -e 's!%%PREFIX%%!${PREFIX}!g' ${PORTEXAMPLES} post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/chronyc ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/chronyd ${INSTALL_DATA} ${WRKSRC}/examples/chrony.conf.example3 \ ${STAGEDIR}${PREFIX}/etc/chrony.conf.sample post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} cd ${WRKSRC}/examples && \ ${INSTALL_DATA} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR} .include Index: head/net/chrony/files/patch-ntp__io.c =================================================================== --- head/net/chrony/files/patch-ntp__io.c (nonexistent) +++ head/net/chrony/files/patch-ntp__io.c (revision 488567) @@ -0,0 +1,65 @@ +From 6af39d63aa9323b4b8c39efe24ae0c88c949a901 Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Mon, 3 Dec 2018 15:51:54 +0100 +Subject: ntp: don't use IP_SENDSRCADDR on bound socket + +On FreeBSD, sendmsg() fails when IP_SENDSRCADDR specifies a source +address on a socket that is bound to the address. This prevents a server +configured with the bindaddress directive from responding to clients. + +Add a new variable to check whether the server IPv4 socket is not bound +before setting the source address. +--- ntp_io.c.orig 2018-09-19 14:38:15 UTC ++++ ntp_io.c +@@ -105,6 +105,9 @@ static int separate_client_sockets; + disabled */ + static int permanent_server_sockets; + ++/* Flag indicating the server IPv4 socket is bound to an address */ ++static int bound_server_sock_fd4; ++ + /* Flag indicating that we have been initialised */ + static int initialised=0; + +@@ -168,6 +171,9 @@ prepare_socket(int family, int port_number, int client + my_addr.in4.sin_port = htons(port_number); + my_addr_len = sizeof (my_addr.in4); + ++ if (!client_only) ++ bound_server_sock_fd4 = my_addr.in4.sin_addr.s_addr != htonl(INADDR_ANY); ++ + break; + #ifdef FEAT_IPV6 + case AF_INET6: +@@ -821,8 +827,8 @@ NIO_SendPacket(NTP_Packet *packet, NTP_Remote_Address + msg.msg_flags = 0; + cmsglen = 0; + +- if (local_addr->ip_addr.family == IPADDR_INET4) { + #ifdef HAVE_IN_PKTINFO ++ if (local_addr->ip_addr.family == IPADDR_INET4) { + struct in_pktinfo *ipi; + + cmsg = CMSG_FIRSTHDR(&msg); +@@ -837,7 +843,11 @@ NIO_SendPacket(NTP_Packet *packet, NTP_Remote_Address + ipi->ipi_spec_dst.s_addr = htonl(local_addr->ip_addr.addr.in4); + if (local_addr->if_index != INVALID_IF_INDEX) + ipi->ipi_ifindex = local_addr->if_index; ++ } + #elif defined(IP_SENDSRCADDR) ++ /* Specify the IPv4 source address only if the socket is not bound */ ++ if (local_addr->ip_addr.family == IPADDR_INET4 && ++ local_addr->sock_fd == server_sock_fd4 && !bound_server_sock_fd4) { + struct in_addr *addr; + + cmsg = CMSG_FIRSTHDR(&msg); +@@ -850,8 +860,8 @@ NIO_SendPacket(NTP_Packet *packet, NTP_Remote_Address + + addr = (struct in_addr *)CMSG_DATA(cmsg); + addr->s_addr = htonl(local_addr->ip_addr.addr.in4); +-#endif + } ++#endif + + #ifdef HAVE_IN6_PKTINFO + if (local_addr->ip_addr.family == IPADDR_INET6) { Property changes on: head/net/chrony/files/patch-ntp__io.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property