patch for PPPoE problem
- From: "陈鑫" <znscnchen gmail com>
- To: networkmanager-list gnome org
- Subject: patch for PPPoE problem
- Date: Wed, 16 Apr 2008 21:56:50 +0800
Dear Dan,
I used PPPoE function of NetworkManager with ppp-2.4.4,I
found some problems and fixed it.
ChangeLog
* src/nm-device-802-3-ethernet.c
-(real_deactivate_quickly): clear ip_iface of the device.
nm_system_device_set_from_ip4_config() used to use pppoe interface,
when link changes from pppoe to dhcp,
* src/ppp-manager/nm-pppd-plugin.c
-(get_credentials): when checking pap authentication in
pppd, parameter passwd is NULL, check it and return 1 to support pap.
-(plugin_init): define chap_check_hook() to support chap
authentication.
* src/ppp-manager/nm-ppp-manager.c
-(create_pppd_cmd_line): fixed obvious error when creating
pppd command line.
Regards,
znscn
diff -uprN NetworkManager/src/nm-device-802-3-ethernet.c NetworkManager.new/src/nm-device-802-3-ethernet.c
--- NetworkManager/src/nm-device-802-3-ethernet.c 2008-04-08 18:13:46.000000000 +0800
+++ NetworkManager.new/src/nm-device-802-3-ethernet.c 2008-04-16 17:30:28.000000000 +0800
@@ -1218,6 +1218,8 @@ real_deactivate_quickly (NMDevice *devic
{
NMDevice8023EthernetPrivate *priv = NM_DEVICE_802_3_ETHERNET_GET_PRIVATE (device);
+ nm_device_set_ip_iface (device, NULL);
+
if (priv->pending_ip4_config) {
g_object_unref (priv->pending_ip4_config);
priv->pending_ip4_config = NULL;
diff -uprN NetworkManager/src/ppp-manager/nm-pppd-plugin.c NetworkManager.new/src/ppp-manager/nm-pppd-plugin.c
--- NetworkManager/src/ppp-manager/nm-pppd-plugin.c 2008-04-08 17:42:26.000000000 +0800
+++ NetworkManager.new/src/ppp-manager/nm-pppd-plugin.c 2008-04-16 17:27:53.000000000 +0800
@@ -204,6 +204,12 @@ nm_ip_up (void *data, int arg)
}
static int
+get_chap_check()
+{
+ return 1;
+}
+
+static int
get_credentials (char *username, char *password)
{
char *my_username;
@@ -211,6 +217,11 @@ get_credentials (char *username, char *p
size_t len;
GError *err = NULL;
+ if(password == NULL) {
+ g_warning("password pointer is NULL\n");
+ return 1;
+ }
+
g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), -1);
my_username = my_password = NULL;
@@ -246,7 +257,7 @@ get_credentials (char *username, char *p
g_free (my_password);
}
- return 0;
+ return 1;
}
static void
@@ -281,6 +292,7 @@ plugin_init (void)
dbus_g_connection_unref (bus);
chap_passwd_hook = get_credentials;
+ chap_check_hook = get_chap_check;
pap_passwd_hook = get_credentials;
add_notifier (&phasechange, nm_phasechange, NULL);
diff -uprN NetworkManager/src/ppp-manager/nm-ppp-manager.c NetworkManager.new/src/ppp-manager/nm-ppp-manager.c
--- NetworkManager/src/ppp-manager/nm-ppp-manager.c 2008-04-08 17:42:26.000000000 +0800
+++ NetworkManager.new/src/ppp-manager/nm-ppp-manager.c 2008-04-16 17:34:32.000000000 +0800
@@ -525,23 +525,23 @@ create_pppd_cmd_line (NMSettingPPP *sett
if (setting->noauth)
nm_cmd_line_add_string (cmd, "noauth");
- if (setting->noauth)
- nm_cmd_line_add_string (cmd, "refuse-eap");
if (setting->refuse_eap)
- nm_cmd_line_add_string (cmd, "refuse-chap");
+ nm_cmd_line_add_string (cmd, "refuse-eap");
if (setting->refuse_chap)
- nm_cmd_line_add_string (cmd, "refuse-mschap");
+ nm_cmd_line_add_string (cmd, "refuse-chap");
if (setting->refuse_mschap)
- nm_cmd_line_add_string (cmd, "nobsdcomp");
+ nm_cmd_line_add_string (cmd, "refuse-mschap");
if (setting->nobsdcomp)
- nm_cmd_line_add_string (cmd, "nodeflate");
+ nm_cmd_line_add_string (cmd, "nobsdcomp");
if (setting->nodeflate)
- nm_cmd_line_add_string (cmd, "require-mppe");
+ nm_cmd_line_add_string (cmd, "nodeflate");
if (setting->require_mppe)
- nm_cmd_line_add_string (cmd, "require-mppe-128");
+ nm_cmd_line_add_string (cmd, "require-mppe");
if (setting->require_mppe_128)
- nm_cmd_line_add_string (cmd, "mppe-stateful");
+ nm_cmd_line_add_string (cmd, "require-mppe-128");
if (setting->mppe_stateful)
+ nm_cmd_line_add_string (cmd, "mppe-stateful");
+ if (setting->require_mppc)
nm_cmd_line_add_string (cmd, "require-mppc");
if (setting->crtscts)
nm_cmd_line_add_string (cmd, "crtscts");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]