]> git.feebdaed.xyz Git - 0xmirror/libreswan.git/commitdiff
connections: log when loaded+oriented connection still needs DNS
authorAndrew Cagney <cagney@gnu.org>
Sun, 21 Dec 2025 15:46:27 +0000 (10:46 -0500)
committerAndrew Cagney <cagney@gnu.org>
Sun, 21 Dec 2025 15:46:27 +0000 (10:46 -0500)
programs/pluto/connections.c
programs/pluto/connections.h
programs/pluto/orient.c

index 054e48ac8b16a2800c9b6af8e83bc1944f5c4203..4b712f38391c65d6aa8e45fcf0a5d02fe3ee2df2 100644 (file)
@@ -2193,6 +2193,12 @@ bool never_negotiate(const struct connection *c)
        return (c->config->never_negotiate_shunt != SHUNT_UNSET);
 }
 
+bool connection_end_needs_dns(const struct connection_end *end)
+{
+       return (end->config->host.host.type == KH_IPHOSTNAME &&
+               !address_is_specified(end->host.addr));
+}
+
 bool is_opportunistic(const struct connection *c)
 {
        return (c != NULL && c->config->opportunistic);
index 499d1159286d10d25468187bdff5d627f20cffff..aea1e0d921ed47d5f0c599163651d66104afdf1b 100644 (file)
@@ -1220,6 +1220,8 @@ bool is_opportunistic_instance(const struct connection *c);
 
 bool is_xauth(const struct connection *c);
 
+bool connection_end_needs_dns(const struct connection_end *end);
+
 /* IKE SA | ISAKMP SA || Child SA | IPsec SA */
 const char *connection_sa_name(const struct connection *c, enum sa_kind sa_kind);
 /* IKE | ISAKMP || Child | IPsec */
index 659e8b0a2665a3da3cce0be0d06db9ba01cd586e..015d721bd7f9113e9d5d558d6f726fc162c1706e 100644 (file)
@@ -535,6 +535,15 @@ void jam_orientation(struct jambuf *buf,
                        jam_string(buf, " remote: ");
                        jam_host_addr(buf, c->remote);
                        jam_string(buf, ")");
+               } else if (connection_end_needs_dns(c->remote)) {
+                       /*
+                        * Can only be .remote; if .local's lookup
+                        * failed then .local wouldn't have an address
+                        * and couldn't orient.
+                        */
+                       jam_string(buf, " (remote: ");
+                       jam_host_addr(buf, c->remote);
+                       jam_string(buf, " requires DNS lookup)");
                }
        } else if (listening) {
                /*