From: Wouter Wijngaards Date: Tue, 19 Jun 2018 09:40:59 +0000 (+0000) Subject: - Fix for unbound-control on Windows and set TCP socket parameters X-Git-Tag: release-1.8.0rc1~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b092127cba50815bebf1e097efddbf745714bdf;p=thirdparty%2Funbound.git - Fix for unbound-control on Windows and set TCP socket parameters more closely. git-svn-id: file:///svn/unbound/trunk@4743 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 1fb7bd454..c1e3f2d61 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +19 June 2018: Wouter + - Fix for unbound-control on Windows and set TCP socket parameters + more closely. + 18 June 2018: Wouter - Fix that control-use-cert: no works for 127.0.0.1 to disable certs. This fix is part of 1.7.3rc2. diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index e31ca7f90..c794e4258 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -489,7 +489,7 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd) { struct sockaddr_storage addr; socklen_t addrlen; - int addrfamily = 0; + int addrfamily = 0, proto = IPPROTO_TCP; int fd, useport = 1; /* use svr or the first config entry */ if(!svr) { @@ -523,6 +523,7 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd) addrlen = (socklen_t)sizeof(struct sockaddr_un); addrfamily = AF_LOCAL; useport = 0; + proto = 0; #endif } else { if(!ipstrtoaddr(svr, cfg->control_port, &addr, &addrlen)) @@ -530,8 +531,8 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd) } if(addrfamily == 0) - addrfamily = addr_is_ip6(&addr, addrlen)?AF_INET6:AF_INET; - fd = socket(addrfamily, SOCK_STREAM, 0); + addrfamily = addr_is_ip6(&addr, addrlen)?PF_INET6:PF_INET; + fd = socket(addrfamily, SOCK_STREAM, proto); if(fd == -1) { #ifndef USE_WINSOCK fatal_exit("socket: %s", strerror(errno));