NetworkManager r3574 - in trunk: . libnm-util src/ppp-manager
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3574 - in trunk: . libnm-util src/ppp-manager
- Date: Fri, 18 Apr 2008 00:21:27 +0100 (BST)
Author: dcbw
Date: Thu Apr 17 23:21:27 2008
New Revision: 3574
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3574&view=rev
Log:
2008-04-17 Dan Williams <dcbw redhat com>
* libnm-util/nm-setting-pppoe.c
- (verify): require a PPP setting too
* src/ppp-manager/nm-ppp-manager.c
- (nm_ppp_manager_start): fail if no PPP setting is present instead of
segfaulting
Modified:
trunk/ChangeLog
trunk/libnm-util/nm-setting-pppoe.c
trunk/src/ppp-manager/nm-ppp-manager.c
Modified: trunk/libnm-util/nm-setting-pppoe.c
==============================================================================
--- trunk/libnm-util/nm-setting-pppoe.c (original)
+++ trunk/libnm-util/nm-setting-pppoe.c Thu Apr 17 23:21:27 2008
@@ -2,6 +2,7 @@
#include <string.h>
#include "nm-setting-pppoe.h"
+#include "nm-setting-ppp.h"
G_DEFINE_TYPE (NMSettingPPPOE, nm_setting_pppoe, NM_TYPE_SETTING)
@@ -20,6 +21,15 @@
return (NMSetting *) g_object_new (NM_TYPE_SETTING_PPPOE, NULL);
}
+static gint
+find_setting_by_name (gconstpointer a, gconstpointer b)
+{
+ NMSetting *setting = NM_SETTING (a);
+ const char *str = (const char *) b;
+
+ return strcmp (nm_setting_get_name (setting), str);
+}
+
static gboolean
verify (NMSetting *setting, GSList *all_settings)
{
@@ -35,6 +45,11 @@
return FALSE;
}
+ if (!g_slist_find_custom (all_settings, NM_SETTING_PPP_SETTING_NAME, find_setting_by_name)) {
+ g_warning ("Invalid or missing PPP setting");
+ return FALSE;
+ }
+
return TRUE;
}
Modified: trunk/src/ppp-manager/nm-ppp-manager.c
==============================================================================
--- trunk/src/ppp-manager/nm-ppp-manager.c (original)
+++ trunk/src/ppp-manager/nm-ppp-manager.c Thu Apr 17 23:21:27 2008
@@ -634,8 +634,9 @@
connection = nm_act_request_get_connection (req);
ppp_setting = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP));
+ g_return_val_if_fail (ppp_setting != NULL, FALSE);
+
pppoe_setting = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE);
-
if (pppoe_setting)
pppoe_fill_defaults (ppp_setting);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]