diff options
author | Linus Nordberg <linus@nordu.net> | 2012-04-25 17:41:27 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2012-04-25 17:41:27 +0200 |
commit | 19b5ce7ac3f838e689ae6e6b1e4a0c114b44ce67 (patch) | |
tree | 8b1cf80d30846833111d1e6733a8031408fb2321 /lib/packet.c | |
parent | 41ca60fee8c14f74af22bbeeda56574e883c21a9 (diff) |
Postpone resolving of DNS names of server.
We used to resolve DNS names when reading configuration. We now do it
in event_init_socket() and cache the result in the connection object.
The imminent need for changing this is to keep host names around for
X509 certificate verification (CNAME and subjectAltName). This will
also help later when we implement server failover (and later, when
people want to do more dynamic configuration, f.ex. NAPTR).
Diffstat (limited to 'lib/packet.c')
-rw-r--r-- | lib/packet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/packet.c b/lib/packet.c index a7e09f6..8e6f22d 100644 --- a/lib/packet.c +++ b/lib/packet.c @@ -85,8 +85,8 @@ packet_do_send (struct rs_packet *pkt) { char host[80], serv[80]; - getnameinfo (pkt->conn->active_peer->addr->ai_addr, - pkt->conn->active_peer->addr->ai_addrlen, + getnameinfo (pkt->conn->active_peer->addr_cache->ai_addr, + pkt->conn->active_peer->addr_cache->ai_addrlen, host, sizeof(host), serv, sizeof(serv), 0 /* NI_NUMERICHOST|NI_NUMERICSERV*/); rs_debug (("%s: about to send this to %s:%s:\n", __func__, host, serv)); |