[network-manager-libreswan/lr/import-export: 5/7] common: don't use uuid for name when exporting the connection



commit 0d17fda25b78b479fa34c7dc74f143752de13b2b
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Dec 7 13:53:43 2015 +0100

    common: don't use uuid for name when exporting the connection
    
    It's just not nice.

 common/utils.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/common/utils.c b/common/utils.c
index 7493f3a..9e68a41 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -43,12 +43,19 @@ nm_libreswan_config_write (gint fd,
                            gboolean openswan)
 {
        NMSettingVpn *s_vpn = nm_connection_get_setting_vpn (connection);
-       const char *con_name = nm_connection_get_uuid (connection);
+       const char *con_name;
        const char *props_username;
        const char *default_username;
        const char *phase1_alg_str;
        const char *phase2_alg_str;
 
+       /* We abuse the presence of bus name to decide if we're exporting
+        * the connection or actually configuring Pluto. */
+       if (bus_name)
+               con_name = nm_connection_get_uuid (connection);
+       else
+               con_name = nm_connection_get_id (connection);
+
        g_assert (fd >= 0);
        g_assert (s_vpn);
        g_assert (con_name);


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