From: Wouter Wijngaards Date: Fri, 16 Jan 2015 13:11:07 +0000 (+0000) Subject: - unit test for local unix connection. Documentation and log_addr X-Git-Tag: release-1.5.2rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92e26a89ad5a737325b33dbc9bcda141c2646ed7;p=thirdparty%2Funbound.git - unit test for local unix connection. Documentation and log_addr does not inspect port for AF_LOCAL. git-svn-id: file:///svn/unbound/trunk@3315 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 7bd1ea8c7..db5ad8cde 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +16 January 2015: Wouter + - unit test for local unix connection. Documentation and log_addr + does not inspect port for AF_LOCAL. + 13 January 2015: Wouter - iana portlist update. diff --git a/doc/example.conf.in b/doc/example.conf.in index e4a01d634..c6e47a279 100644 --- a/doc/example.conf.in +++ b/doc/example.conf.in @@ -553,6 +553,10 @@ remote-control: # set up the keys and certificates with unbound-control-setup. # control-enable: no + # Set to no and use an absolute path as control-interface to use + # a unix local named pipe for unbound-control. + # control-use-cert: yes + # what interfaces are listened to for remote control. # give 0.0.0.0 and ::0 to listen to all interfaces. # control-interface: 127.0.0.1 diff --git a/testdata/ctrl_pipe.tpkg b/testdata/ctrl_pipe.tpkg new file mode 100644 index 000000000..06695e820 Binary files /dev/null and b/testdata/ctrl_pipe.tpkg differ diff --git a/util/net_help.c b/util/net_help.c index 335ee7499..e2b7c3878 100644 --- a/util/net_help.c +++ b/util/net_help.c @@ -156,7 +156,12 @@ log_addr(enum verbosity_value v, const char* str, case AF_INET6: family="ip6"; sinaddr = &((struct sockaddr_in6*)addr)->sin6_addr; break; - case AF_LOCAL: family="local"; break; + case AF_LOCAL: + dest[0]=0; + (void)inet_ntop(af, sinaddr, dest, + (socklen_t)sizeof(dest)); + verbose(v, "%s local %s", str, dest); + return; /* do not continue and try to get port */ default: break; } if(inet_ntop(af, sinaddr, dest, (socklen_t)sizeof(dest)) == 0) {