summaryrefslogtreecommitdiff
path: root/src/socket-proxy
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-12-15 21:01:06 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-17 10:02:36 +0900
commitf2935c77c63afa25cd38577477cb753a96b28513 (patch)
treeaba6342a4de0fcef65462958082a634662b45490 /src/socket-proxy
parent1061dab129df8ca42ec2cd17700cd90b741f2389 (diff)
downloadsystemd-f2935c77c63afa25cd38577477cb753a96b28513.tar.gz
socket-proxyd: use typesafe resolve_getaddrinfo()
Diffstat (limited to 'src/socket-proxy')
-rw-r--r--src/socket-proxy/socket-proxyd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index 47a2156aa2..f882a665a8 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -22,6 +22,7 @@
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
+#include "resolve-private.h"
#include "set.h"
#include "socket-util.h"
#include "string-util.h"
@@ -347,9 +348,7 @@ fail:
return 0; /* ignore errors, continue serving */
}
-static int resolve_cb(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata) {
- Connection *c = userdata;
-
+static int resolve_handler(sd_resolve_query *q, int ret, const struct addrinfo *ai, Connection *c) {
assert(q);
assert(c);
@@ -401,7 +400,7 @@ static int resolve_remote(Connection *c) {
}
log_debug("Looking up address info for %s:%s", node, service);
- r = sd_resolve_getaddrinfo(c->context->resolve, &c->resolve_query, node, service, &hints, resolve_cb, c);
+ r = resolve_getaddrinfo(c->context->resolve, &c->resolve_query, node, service, &hints, resolve_handler, NULL, c);
if (r < 0) {
log_error_errno(r, "Failed to resolve remote host: %m");
goto fail;