[Openswan dev] [PATCH] Set dnshostname when using libipsecconf

Mattias Walstrom lazzer at vmlinux.org
Fri Feb 11 14:13:01 EST 2011


This is to solve issue #1201 (dpd + ddns does not work), the entry conn->dnshostname is used through out the system but it never will be set if using addconn to add the tunnel. This patch will make sure that variable is sent in the whack message if the user has entered a domainname.

Signed-off-by: Mattias Walström <lazzer at vmlinux.org> 
---
starterwhack.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/libipsecconf/starterwhack.c b/lib/libipsecconf/starterwhack.c
index b22e697..9c0dadd 100644
--- a/lib/libipsecconf/starterwhack.c
+++ b/lib/libipsecconf/starterwhack.c
@@ -474,6 +474,11 @@ static int starter_whack_basic_add_conn(struct starter_config *cfg
        msg.addr_family = conn->left.addr_family;
        msg.tunnel_addr_family = conn->left.addr_family;
 
+        if (conn->right.addrtype == KH_IPHOSTNAME)
+        {
+           msg.dnshostname = conn->right.strings[KSCF_IP];
+        }
+
        msg.sa_ike_life_seconds = conn->options[KBF_IKELIFETIME];
        msg.sa_ipsec_life_seconds = conn->options[KBF_SALIFETIME];
        msg.sa_rekey_margin = conn->options[KBF_REKEYMARGIN];


More information about the Dev mailing list