[network-manager-openswan/dcbw/cleanups: 1/17] core: recognize some helper script options libreswan renamed



commit 48c232efaaf9173fd4d181f7ec7ca24397010550
Author: Dan Williams <dcbw redhat com>
Date:   Mon Aug 4 12:14:47 2014 -0500

    core: recognize some helper script options libreswan renamed

 src/nm-openswan-service-helper.c |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/nm-openswan-service-helper.c b/src/nm-openswan-service-helper.c
index 3a16aae..285d16c 100644
--- a/src/nm-openswan-service-helper.c
+++ b/src/nm-openswan-service-helper.c
@@ -191,11 +191,13 @@ addr_list_to_gvalue (const char *str)
 /*
  * Environment variables passed back from 'openswan':
  *
- * PLUTO_PEER                  -- vpn gateway address
- * PLUTO_MY_SOURCEIP           -- address
- * PLUTO_CISCO_DNS_INFO         -- list of dns serverss
- * PLUTO_CISCO_DOMAIN_INFO      -- default domain name
- * PLUTO_PEER_BANNER           -- banner from server
+ * PLUTO_PEER                -- vpn gateway address
+ * PLUTO_MY_SOURCEIP         -- address
+ * PLUTO_CISCO_DNS_INFO/     -- list of dns serverss
+ *    PLUTO_PEER_DNS_INFO
+ * PLUTO_CISCO_DOMAIN_INFO/  -- default domain name
+ *    PLUTO_PEER_DOMAIN_INFO
+ * PLUTO_PEER_BANNER         -- banner from server
  *
  */
 int 
@@ -217,7 +219,9 @@ main (int argc, char *argv[])
         * don't proceed unless its "connect".
         */
        tmp = getenv ("openswan_reason");
-       if (tmp && strcmp (tmp, "connect") != 0)
+       if (!tmp)
+               tmp = getenv ("libreswan_reason");
+       if (g_strcmp0 (tmp, "connect") != 0)
                exit (0);
 
        
@@ -285,12 +289,20 @@ main (int argc, char *argv[])
 
        /* DNS */
        val = addr_list_to_gvalue (getenv ("PLUTO_CISCO_DNS_INFO"));
+       if (!val) {
+               /* libreswan value */
+               val = addr_list_to_gvalue (getenv ("PLUTO_PEER_DNS_INFO"));
+       }
        if (val)
                g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_DNS, val);
 
 
        /* Default domain */
        val = str_to_gvalue (getenv ("PLUTO_CISCO_DOMAIN_INFO"), TRUE);
+       if (!val) {
+               /* libreswan value */
+               val = str_to_gvalue (getenv ("PLUTO_PEER_DOMAIN_INFO"), TRUE);
+       }
        if (val)
                g_hash_table_insert (config, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN, val);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]