Re: patch for PPPoE problem
- From: "陈鑫" <znscnchen gmail com>
- To: "Dan Williams" <dcbw redhat com>, "Björn Martensen" <bjoern martensen gmail com>
- Cc: networkmanager-list gnome org
- Subject: Re: patch for PPPoE problem
- Date: Thu, 17 Apr 2008 10:56:01 +0800
Hi,
As to the mentioned failing to build, the problem may be due to
gcc version, I build correctly with gcc 4.1.2.
Consequently, I suggest that checking local variable 'username'
should be used instead of checking global variable'user' to avoid the
error.
Dan, I've verified the PPPoE function with pap and chap
authentication, and fixed another bug. see below
ChangeLog
* src/ppp-manager/nm-ppp-manager.c
- (nm_ppp_manager_start): add valid check for
ppp_setting, which if non-initialized would cause crash
2008/4/17, Björn Martensen <bjoern martensen gmail com>:
> On Wed, 2008-04-16 at 16:03 -0400, Dan Williams wrote:
> > On Wed, 2008-04-16 at 21:56 +0800, 陈鑫 wrote:
> > > Dear Dan,
> > >
> > > I used PPPoE function of NetworkManager with ppp-2.4.4,I
> > > found some problems and fixed it.
> >
> > Thanks! Committed to SVN. Can you verify that the version I committed
> > works for you? I added a pap_check_hook that returns 1, which from
> > reading pppd/auth.c and PLUGINS in pppd seem to be what we should be
> > doing there.
>
>
> after the last patch svn doesn't build for me anymore:
>
>
> > libtool: link: ( cd ".libs" && rm -f "libppp-manager.la" && ln -s "../libppp-manager.la" "libppp-manager.la" )
> > /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../libnm-util -I../../src -I../../marshallers -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DDBUS_VERSION_MAJOR=1 -DDBUS_VERSION_MINOR=1 -DDBUS_VERSION_MICRO=20 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Werror -std=gnu89 -march=i686 -mtune=generic -O2 -pipe -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -MT nm_pppd_plugin_la-nm-pppd-plugin.lo -MD -MP -MF .deps/nm_pppd_plugin_la-nm-pppd-plugin.Tpo -c -o nm_pppd_plugin_la-nm-pppd-plugin.lo `test -f 'nm-pppd-plugin.c' || echo './'`nm-pppd-plugin.c
> > libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../libnm-util -I../../src -I../../marshallers -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DDBUS_VERSION_MAJOR=1 -DDBUS_VERSION_MINOR=1 -DDBUS_VERSION_MICRO=20 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Werror -std=gnu89 -march=i686 -mtune=generic -O2 -pipe -Wshadow -Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare -MT nm_pppd_plugin_la-nm-pppd-plugin.lo -MD -MP -MF .deps/nm_pppd_plugin_la-nm-pppd-plugin.Tpo -c nm-pppd-plugin.c -fPIC -DPIC -o .libs/nm_pppd_plugin_la-nm-pppd-plugin.o
> > cc1: warnings being treated as errors
> > nm-pppd-plugin.c: In function 'get_credentials':
> > nm-pppd-plugin.c:226: error: the address of 'user' will always evaluate as 'true'
> > make[4]: *** [nm_pppd_plugin_la-nm-pppd-plugin.lo] Error 1
>
>
> Björn
>
>
>
> > Dan
> >
> > > 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
> > > _______________________________________________
> > > NetworkManager-list mailing list
> > > NetworkManager-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> >
> > _______________________________________________
> > NetworkManager-list mailing list
> > NetworkManager-list gnome org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
>
--- NetworkManager/src/ppp-manager/nm-ppp-manager.c 2008-04-17 10:35:16.000000000 +0800
+++ NetworkManager.new/src/ppp-manager/nm-ppp-manager.c 2008-04-17 09:56:49.000000000 +0800
@@ -636,6 +636,9 @@ nm_ppp_manager_start (NMPPPManager *mana
ppp_setting = NM_SETTING_PPP (nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP));
pppoe_setting = (NMSettingPPPOE *) nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE);
+ if (!ppp_setting)
+ ppp_setting = (NMSettingPPP *) nm_setting_ppp_new();
+
if (pppoe_setting)
pppoe_fill_defaults (ppp_setting);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]