From aed37465be287ff2c0f6aa061ae0ea97cf0b559b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 16 Nov 2011 10:03:02 +0100 Subject: [PATCH] ppp: change handling of lcp-echo-failure and lcp-echo-interval (bgo #663970) Don't set default values for the properties, which didn't allow users to switch off sending echo-request packets. Rather set defaults in editor or while completing connection for modems. --- src/modem-manager/nm-modem-cdma.c | 12 ++++++++++++ src/modem-manager/nm-modem-gsm.c | 12 ++++++++++++ src/ppp-manager/nm-ppp-manager.c | 8 +------- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c index 3d2153b28d..c822d35929 100644 --- a/src/modem-manager/nm-modem-cdma.c +++ b/src/modem-manager/nm-modem-cdma.c @@ -32,6 +32,7 @@ #include "nm-dbus-manager.h" #include "nm-setting-connection.h" #include "nm-setting-cdma.h" +#include "nm-setting-ppp.h" #include "NetworkManagerUtils.h" #include "nm-logging.h" @@ -280,6 +281,7 @@ real_complete_connection (NMModem *modem, GError **error) { NMSettingCdma *s_cdma; + NMSettingPPP *s_ppp; s_cdma = nm_connection_get_setting_cdma (connection); if (!s_cdma) { @@ -290,6 +292,16 @@ real_complete_connection (NMModem *modem, if (!nm_setting_cdma_get_number (s_cdma)) g_object_set (G_OBJECT (s_cdma), NM_SETTING_CDMA_NUMBER, "#777", NULL); + s_ppp = nm_connection_get_setting_ppp (connection); + if (!s_ppp) { + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + g_object_set (G_OBJECT (s_ppp), + NM_SETTING_PPP_LCP_ECHO_FAILURE, 5, + NM_SETTING_PPP_LCP_ECHO_INTERVAL, 30, + NULL); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); + } + nm_utils_complete_generic (connection, NM_SETTING_CDMA_SETTING_NAME, existing_connections, diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c index f5f856b1d0..3031694eb3 100644 --- a/src/modem-manager/nm-modem-gsm.c +++ b/src/modem-manager/nm-modem-gsm.c @@ -30,6 +30,7 @@ #include "nm-device-private.h" #include "nm-setting-connection.h" #include "nm-setting-gsm.h" +#include "nm-setting-ppp.h" #include "nm-modem-types.h" #include "nm-logging.h" #include "NetworkManagerUtils.h" @@ -501,6 +502,7 @@ real_complete_connection (NMModem *modem, GError **error) { NMSettingGsm *s_gsm; + NMSettingPPP *s_ppp; s_gsm = nm_connection_get_setting_gsm (connection); if (!s_gsm || !nm_setting_gsm_get_apn (s_gsm)) { @@ -515,6 +517,16 @@ real_complete_connection (NMModem *modem, if (!nm_setting_gsm_get_number (s_gsm)) g_object_set (G_OBJECT (s_gsm), NM_SETTING_GSM_NUMBER, "*99#", NULL); + s_ppp = nm_connection_get_setting_ppp (connection); + if (!s_ppp) { + s_ppp = (NMSettingPPP *) nm_setting_ppp_new (); + g_object_set (G_OBJECT (s_ppp), + NM_SETTING_PPP_LCP_ECHO_FAILURE, 5, + NM_SETTING_PPP_LCP_ECHO_INTERVAL, 30, + NULL); + nm_connection_add_setting (connection, NM_SETTING (s_ppp)); + } + nm_utils_complete_generic (connection, NM_SETTING_GSM_SETTING_NAME, existing_connections, diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 9b937333a1..59698c3425 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #include @@ -935,12 +935,6 @@ pppoe_fill_defaults (NMSettingPPP *setting) if (!nm_setting_ppp_get_mru (setting)) g_object_set (setting, NM_SETTING_PPP_MRU, (guint32) 1492, NULL); - if (!nm_setting_ppp_get_lcp_echo_interval (setting)) - g_object_set (setting, NM_SETTING_PPP_LCP_ECHO_INTERVAL, (guint32) 20, NULL); - - if (!nm_setting_ppp_get_lcp_echo_failure (setting)) - g_object_set (setting, NM_SETTING_PPP_LCP_ECHO_FAILURE, (guint32) 3, NULL); - g_object_set (setting, NM_SETTING_PPP_NOAUTH, TRUE, NM_SETTING_PPP_NODEFLATE, TRUE,