[PATCH v2 15/16] l2tp: Suggest already saved username

Jukka Rissanen jukka.rissanen at linux.intel.com
Tue Nov 27 02:51:47 PST 2012


If we know the username, send it to agent as a hint what username
was used earlier.
---
 vpn/plugins/l2tp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vpn/plugins/l2tp.c b/vpn/plugins/l2tp.c
index 746cc16..fd96167 100644
--- a/vpn/plugins/l2tp.c
+++ b/vpn/plugins/l2tp.c
@@ -507,13 +507,19 @@ static void request_input_append_host(DBusMessageIter *iter, void *user_data)
 static void request_input_append_user_info(DBusMessageIter *iter,
 							void *user_data)
 {
-	char *str = "string";
+	struct vpn_provider *provider = user_data;
+	const char *str = "string";
 
 	connman_dbus_dict_append_basic(iter, "Type",
 				DBUS_TYPE_STRING, &str);
 	str = "mandatory";
 	connman_dbus_dict_append_basic(iter, "Requirement",
 				DBUS_TYPE_STRING, &str);
+
+	str = vpn_provider_get_string(provider, "L2TP.User");
+	if (str != NULL)
+		connman_dbus_dict_append_basic(iter, "Value",
+					DBUS_TYPE_STRING, &str);
 }
 
 struct request_input_reply {
-- 
1.7.11.4




More information about the connman mailing list