NetworkManager r4235 - in trunk: . src/ppp-manager



Author: dcbw
Date: Thu Oct 30 05:20:53 2008
New Revision: 4235
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4235&view=rev

Log:
2008-10-30  Dan Williams  <dcbw redhat com>

	* src/ppp-manager/nm-ppp-manager.c
		- (nm_ppp_manager_start): if /dev/ppp doesn't exist, load the
			ppp_generic module to create it (bgo #533064)



Modified:
   trunk/ChangeLog
   trunk/src/ppp-manager/nm-ppp-manager.c

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 Oct 30 05:20:53 2008
@@ -13,6 +13,7 @@
 #include <sys/ioctl.h>
 #include <asm/types.h>
 #include <net/if.h>
+#include <sys/stat.h>
 
 #include <linux/ppp_defs.h>
 #ifndef aligned_u64
@@ -873,10 +874,15 @@
 	NMSettingPPPOE *pppoe_setting;
 	NMCmdLine *ppp_cmd;
 	char *cmd_str;
+	struct stat st;
 
 	g_return_val_if_fail (NM_IS_PPP_MANAGER (manager), FALSE);
 	g_return_val_if_fail (NM_IS_ACT_REQUEST (req), FALSE);
 
+	/* Make sure /dev/ppp exists (bgo #533064) */
+	if (stat ("/dev/ppp", &st) || !S_ISCHR (st.st_mode))
+		system ("/sbin/modprobe ppp_generic");
+
 	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);



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