Index: branches/2020Q4/dns/unbound/Makefile =================================================================== --- branches/2020Q4/dns/unbound/Makefile (revision 558270) +++ branches/2020Q4/dns/unbound/Makefile (revision 558271) @@ -1,118 +1,119 @@ # Created by: Sergey Matveychuk # $FreeBSD$ PORTNAME= unbound PORTVERSION= 1.13.0 +PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= https://www.nlnetlabs.nl/downloads/unbound/ \ https://distfiles.crux.guru/ MAINTAINER= jaap@NLnetLabs.nl COMMENT= Validating, recursive, and caching DNS resolver LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libexpat.so:textproc/expat2 USES= autoreconf cpe libtool pkgconfig ssl CPE_VENDOR= nlnetlabs GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-ssl=${OPENSSLBASE} --with-libexpat=${LOCALBASE} USE_LDCONFIG= yes TEST_TARGET= test USERS= ${PORTNAME} GROUPS= ${PORTNAME} USE_RC_SUBR= unbound PORTDOCS= CNAME-basedRedirectionDesignNotes.pdf CREDITS Changelog \ FEATURES IP-BasedActions.pdf LICENSE README README.DNS64 \ README.ipset.md README.svn README.tests TODO \ control_proto_spec.txt example.conf ietf67-design-02.odp \ ietf67-design-02.pdf requirements.txt OPTIONS_SUB= yes OPTIONS_DEFINE= DNSCRYPT DNSTAP DOCS DOH ECDSA EVAPI FILTER_AAAA GOST \ HIREDIS LIBEVENT MUNIN_PLUGIN PYTHON SUBNET TFOCL TFOSE \ THREADS OPTIONS_DEFAULT=ECDSA GOST LIBEVENT THREADS LIBEVENT_DESC= Build against libevent GOST_DESC= Enable GOST support (requires OpenSSL >= 1.0) ECDSA_DESC= Enable ECDSA (elliptic curve) support (OpenSSL >= 1.0) MUNIN_PLUGIN_DESC= Install Munin plugin FILTER_AAAA_DESC= Build with AAAA filter functionality (contrib) DNSTAP_DESC= Enable dnstap logging support DNSCRYPT_DESC= Enable dnscrypt support SUBNET_DESC= Enable client subnet support EVAPI_DESC= (Experimental) pluggable event based libunbound API support TFOCL_DESC= Enable TCP Fast Open for client mode TFOSE_DESC= Enable TCP Fast Open for server mode HIREDIS_DESC= Enable hiredis support for the cachedb module DOH_DESC= Enable DNS-over-HTTPS supports STRIP_FILES= .libs/libunbound.so unbound-checkconf unbound \ unbound-control .libs/unbound-host .libs/unbound-anchor DNSTAP_CONFIGURE_ENABLE=dnstap DNSTAP_LIB_DEPENDS= libfstrm.so:devel/fstrm \ libprotobuf-c.so:devel/protobuf-c DNSCRYPT_CONFIGURE_ENABLE= dnscrypt DNSCRYPT_LIB_DEPENDS= libsodium.so:security/libsodium SUBNET_CONFIGURE_ENABLE= subnet EVAPI_CONFIGURE_ENABLE= event-api TFOCL_CONFIGURE_ENABLE= tfo-client TFOSE_CONFIGURE_ENABLE= tfo-server ECDSA_CONFIGURE_ENABLE= ecdsa ECDSA_VARS= DEPENDS_ARGS+=WITH_ECDSA=yes GOST_CONFIGURE_ENABLE= gost GOST_VARS= DEPENDS_ARGS+=WITH_GOST=yes LIBEVENT_CONFIGURE_WITH=libevent LIBEVENT_CPPFLAGS+= $$(pkg-config libevent --cflags-only-I) LIBEVENT_LIB_DEPENDS= libevent.so:devel/libevent LIBEVENT_LDFLAGS+= $$(pkg-config libevent --libs-only-L) MUNIN_PLUGIN_SUB_FILES= pkg-message PYTHON_BUILD_DEPENDS= swig:devel/swig PYTHON_CONFIGURE_ON= --with-pyunbound=yes --with-pythonmodule=yes \ LDFLAGS="-L${LOCALBASE}/lib" \ ac_cv_path_SWIG=${LOCALBASE}/bin/swig PYTHON_USES= python PYTHON_VARS= STRIP_FILES+=.libs/_unbound.so THREADS_CONFIGURE_WITH= pthreads HIREDIS_CONFIGURE_ON= --enable-cachedb --with-libhiredis HIREDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis DOH_CONFIGURE_ON= --with-libnghttp2 DOH_LIB_DEPENDS= libnghttp2.so:www/libnghttp2 post-patch: @${RM} ${WRKSRC}/util/configlexer.c @${REINPLACE_CMD} -e 's|if test ! -e $$(DESTDIR)$$(configfile); then || ; \ s|$$(configfile); fi|$$(configfile).sample|' \ ${WRKSRC}/Makefile.in post-patch-FILTER_AAAA-on: ${CAT} ${WRKSRC}/contrib/aaaa-filter-iterator.patch | ${PATCH} -d ${WRKSRC} -p1 -s post-build: @for s in ${STRIP_FILES}; do ${STRIP_CMD} ${WRKSRC}/$$s; done post-install-PYTHON-on: @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_unbound.so post-install-MUNIN_PLUGIN-on: @${MKDIR} ${STAGEDIR}${PREFIX}/share/munin/plugins ${INSTALL_SCRIPT} ${WRKDIR}/unbound-${PORTVERSION}/contrib/unbound_munin_ \ ${STAGEDIR}${PREFIX}/share/munin/plugins/ @${ECHO_MSG} @${ECHO_MSG} "=============================================================" @${CAT} ${WRKDIR}/pkg-message @${ECHO_MSG} "=============================================================" post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/doc/|} ${STAGEDIR}${DOCSDIR} .include Index: branches/2020Q4/dns/unbound/files/patch-Issue376 =================================================================== --- branches/2020Q4/dns/unbound/files/patch-Issue376 (nonexistent) +++ branches/2020Q4/dns/unbound/files/patch-Issue376 (revision 558271) @@ -0,0 +1,156 @@ +diff --git a/doc/Changelog b/doc/Changelog +index 07a8e6ea4..3b831fea1 100644 +--- doc/Changelog.orig ++++ doc/Changelog +@@ -1,3 +1,7 @@ ++16 December 2020: George ++ - Fix error cases when udp-connect is set and send() returns an error ++ (modified patch from Xin Li @delphij). ++ + 30 November 2020: Wouter + - Fix assertion failure on double callback when iterator loses + interest in query at head of line that then has the tcp stream +diff --git a/services/authzone.c b/services/authzone.c +index 15be5d60c..e59548fc3 100644 +--- services/authzone.c.orig ++++ services/authzone.c +@@ -6093,7 +6093,7 @@ xfr_probe_send_probe(struct auth_xfer* xfr, struct module_env* env, + + /* send udp packet */ + if(!comm_point_send_udp_msg(xfr->task_probe->cp, env->scratch_buffer, +- (struct sockaddr*)&addr, addrlen)) { ++ (struct sockaddr*)&addr, addrlen, 0)) { + char zname[255+1], as[256]; + dname_str(xfr->name, zname); + addr_to_str(&addr, addrlen, as, sizeof(as)); +diff --git a/services/outside_network.c b/services/outside_network.c +index 0886907f7..d8f9874e6 100644 +--- services/outside_network.c.orig ++++ services/outside_network.c +@@ -1899,17 +1899,10 @@ randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout) + log_assert(pend->pc && pend->pc->cp); + + /* send it over the commlink */ +- if(outnet->udp_connect) { +- if(!comm_point_send_udp_msg(pend->pc->cp, packet, NULL, 0)) { +- portcomm_loweruse(outnet, pend->pc); +- return 0; +- } +- } else { +- if(!comm_point_send_udp_msg(pend->pc->cp, packet, +- (struct sockaddr*)&pend->addr, pend->addrlen)) { +- portcomm_loweruse(outnet, pend->pc); +- return 0; +- } ++ if(!comm_point_send_udp_msg(pend->pc->cp, packet, ++ (struct sockaddr*)&pend->addr, pend->addrlen, outnet->udp_connect)) { ++ portcomm_loweruse(outnet, pend->pc); ++ return 0; + } + + /* system calls to set timeout after sending UDP to make roundtrip +diff --git a/testcode/fake_event.c b/testcode/fake_event.c +index 75a6b8db9..5164332c0 100644 +--- testcode/fake_event.c.orig ++++ testcode/fake_event.c +@@ -1766,7 +1766,7 @@ struct comm_point* outnet_comm_point_for_http(struct outside_network* outnet, + } + + int comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, +- struct sockaddr* addr, socklen_t addrlen) ++ struct sockaddr* addr, socklen_t addrlen, int ATTR_UNUSED(is_connected)) + { + struct fake_commpoint* fc = (struct fake_commpoint*)c; + struct replay_runtime* runtime = fc->runtime; +diff --git a/util/netevent.c b/util/netevent.c +index 7c6da50be..88be007e7 100644 +--- util/netevent.c.orig ++++ util/netevent.c +@@ -333,7 +333,7 @@ int tcp_connect_errno_needs_log(struct sockaddr* addr, socklen_t addrlen) + /* send a UDP reply */ + int + comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, +- struct sockaddr* addr, socklen_t addrlen) ++ struct sockaddr* addr, socklen_t addrlen, int is_connected) + { + ssize_t sent; + log_assert(c->fd != -1); +@@ -341,8 +341,8 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, + if(sldns_buffer_remaining(packet) == 0) + log_err("error: send empty UDP packet"); + #endif +- if(addr) { +- log_assert(addr && addrlen > 0); ++ log_assert(addr && addrlen > 0); ++ if(!is_connected) { + sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), + sldns_buffer_remaining(packet), 0, + addr, addrlen); +@@ -367,9 +367,14 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, + #endif + int e; + fd_set_block(c->fd); +- sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), +- sldns_buffer_remaining(packet), 0, +- addr, addrlen); ++ if (!is_connected) { ++ sent = sendto(c->fd, (void*)sldns_buffer_begin(packet), ++ sldns_buffer_remaining(packet), 0, ++ addr, addrlen); ++ } else { ++ sent = send(c->fd, (void*)sldns_buffer_begin(packet), ++ sldns_buffer_remaining(packet), 0); ++ } + e = errno; + fd_set_nonblock(c->fd); + errno = e; +@@ -378,8 +383,12 @@ comm_point_send_udp_msg(struct comm_point *c, sldns_buffer* packet, + if(sent == -1) { + if(!udp_send_errno_needs_log(addr, addrlen)) + return 0; +- verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno)); +- log_addr(VERB_OPS, "remote address is", ++ if (!is_connected) { ++ verbose(VERB_OPS, "sendto failed: %s", sock_strerror(errno)); ++ } else { ++ verbose(VERB_OPS, "send failed: %s", sock_strerror(errno)); ++ } ++ log_addr(VERB_OPS, "remote address is", + (struct sockaddr_storage*)addr, addrlen); + return 0; + } else if((size_t)sent != sldns_buffer_remaining(packet)) { +@@ -764,7 +773,7 @@ comm_point_udp_callback(int fd, short event, void* arg) + buffer = rep.c->buffer; + #endif + (void)comm_point_send_udp_msg(rep.c, buffer, +- (struct sockaddr*)&rep.addr, rep.addrlen); ++ (struct sockaddr*)&rep.addr, rep.addrlen, 0); + } + if(!rep.c || rep.c->fd != fd) /* commpoint closed to -1 or reused for + another UDP port. Note rep.c cannot be reused with TCP fd. */ +@@ -3944,7 +3953,7 @@ comm_point_send_reply(struct comm_reply *repinfo) + repinfo->addrlen, repinfo); + else + comm_point_send_udp_msg(repinfo->c, buffer, +- (struct sockaddr*)&repinfo->addr, repinfo->addrlen); ++ (struct sockaddr*)&repinfo->addr, repinfo->addrlen, 0); + #ifdef USE_DNSTAP + if(repinfo->c->dtenv != NULL && + repinfo->c->dtenv->log_client_response_messages) +diff --git a/util/netevent.h b/util/netevent.h +index 266a74ff3..810190683 100644 +--- util/netevent.h.orig ++++ util/netevent.h +@@ -633,10 +633,11 @@ void comm_point_drop_reply(struct comm_reply* repinfo); + * @param addr: where to send it to. If NULL, send is performed, + * for connected sockets, to the connected address. + * @param addrlen: length of addr. ++ * @param is_connected: if the UDP socket is connect()ed. + * @return: false on a failure. + */ + int comm_point_send_udp_msg(struct comm_point* c, struct sldns_buffer* packet, +- struct sockaddr* addr, socklen_t addrlen); ++ struct sockaddr* addr, socklen_t addrlen,int is_connected); + + /** + * Stop listening for input on the commpoint. No callbacks will happen. Property changes on: branches/2020Q4/dns/unbound/files/patch-Issue376 ___________________________________________________________________ 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 Index: branches/2020Q4 =================================================================== --- branches/2020Q4 (revision 558270) +++ branches/2020Q4 (revision 558271) Property changes on: branches/2020Q4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r558269