After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663970 - Unsetting the attribute 'Send PPP echo packets' does not take effect.
Unsetting the attribute 'Send PPP echo packets' does not take effect.
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2011-11-13 15:44 UTC by mshlyn
Modified: 2012-05-28 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The place where set the 'Sending PPP echo' (49.90 KB, image/png)
2011-11-13 15:51 UTC, mshlyn
  Details
my working pppoe configuration after modification (280 bytes, text/plain)
2011-11-13 15:58 UTC, mshlyn
  Details
don't set default values for lcp-echo-failure,lcp-echo-interval (2.43 KB, patch)
2011-11-16 11:24 UTC, Jiri Klimes
none Details | Review
libnm-util: set default values for lcp-echo-failure,lcp-echo-interval in ppp setting (1.72 KB, patch)
2011-11-16 11:26 UTC, Jiri Klimes
none Details | Review
set defaults in modems' connection complete (4.39 KB, patch)
2011-12-07 17:08 UTC, Jiri Klimes
accepted-commit_now Details | Review
Set default when creating PPP setting in editor (1.25 KB, patch)
2011-12-07 17:09 UTC, Jiri Klimes
accepted-commit_now Details | Review

Description mshlyn 2011-11-13 15:44:21 UTC
The pppoe server in my network has a bug: it reply ppp echo-request with the magic number of client's. And pppd will ignore this reply(pppd thought it was its own echo-reply).
 So I want to forbid my NIC sending any echo-request. But unsetting the attribute 'Send PPP echo packets' on "PPP Settings" page of NM does not take effect.


The actual pppd invoked by NM is as following:

"pppd nodetach lock nodefaultroute user 708 plugin rp-pppoe.so nic-em1 rp_pppoe_service 708 noauth nodeflate usepeerdns mru 1492 mtu 1492 lcp-echo-failure 3 lcp-echo-interval 20 ipparam /org/freedesktop/NetworkManager/PPP/3 plugin /usr/lib/pppd/2.4.5/nm-pppd-plugin.so"

So, pppd will quit every minute.

My temperory solution is set the attribute of 'Send PPP echo packets' and change two parameters(lcp-echo-failure & lcp-echo-interval) in the configuration file '/etc/NetworkManager/system-connections/pppoe_708'. 

By setting "lcp-echo-failure=600" and "lcp-echo-interval=60", my pppd can work normally for 600*60s(10h).

So, the problem is:
Why NM still add options 'lcp-echo-failure 3 lcp-echo-interval 20' to pppd when I have already unset 'Send PPP echo packets'.
Comment 1 mshlyn 2011-11-13 15:51:22 UTC
Created attachment 201318 [details]
The place where set the 'Sending PPP echo'
Comment 2 mshlyn 2011-11-13 15:58:14 UTC
Created attachment 201320 [details]
my working pppoe configuration after modification

If I unset "Send PPP echo packets", there will not be no lcp-echo-failure and lcp-echo-interval lines. But the pppd is still invoked with option "lcp-echo-failue 3 lcp-echo-interval 20".
Comment 3 mshlyn 2011-11-13 16:03:33 UTC
System information:
[OS]: Fedora 16
[NetworkManager Applet]: 0.9.1.90
[uname -a]: Linux localhost.localdomain 3.1.0-7.fc16.i686.PAE #1 SMP Tue Nov 1 20:53:45 UTC 2011 i686 i686 i386 GNU/Linux
Comment 4 Jiri Klimes 2011-11-16 11:21:18 UTC
The editor works well. When "Send PPP echo packets" is checked, lcp-echo-failue is set to 5 and lcp-echo-interval to 30., when unchecked, both are zero and thus not written to the file.

However, NetworkManager daemon sets default values to these properties if they are zero and thus prevents from not sending echos.
Comment 5 Jiri Klimes 2011-11-16 11:24:07 UTC
Created attachment 201523 [details] [review]
don't set default values for lcp-echo-failure,lcp-echo-interval

This patch only sets lcp-echo-failure and lcp-echo-interval pppd's options if they are non-zero.
Comment 6 Jiri Klimes 2011-11-16 11:26:27 UTC
Created attachment 201524 [details] [review]
libnm-util: set default values for lcp-echo-failure,lcp-echo-interval in ppp setting

If we want to preserve default values changed by the previous patch, we should set the default here.
Comment 7 Jiri Klimes 2011-11-16 11:30:09 UTC
Oh, and there's also discrepancy between default values in NM and the editor.
The editor uses lcp-echo-failure=5 and lcp-echo-interval=30 when "Send PPP echo packets" is checked.
Comment 8 mshlyn 2011-11-25 14:10:04 UTC
I have just built a new NetworkManager using the two patches, and it works fine.
when "Send PPP echo packets" is unchecked, there is no "lcp-echo-failure" or "lcp-echo-interval" options appended to pppd command now. So it seems that this bug can be closed.  
Thanks Jiri Kimes!
BTW, do I have to close the bug by myself?
Comment 9 Dan Williams 2011-12-06 18:28:05 UTC
So pppd is a bit stupid with config option handling.  The reason the code always sends some values (even if they are zero) is that pppd will always read config options from /etc/ppp/options.  So if you don't override those options from the command-line explicitly, you may get unexpected results.  For example, if we turn LCP echo testing off (by setting lcp-echo-failure to 0) then to ensure we have the desired result (LCP echo failure testing off) we must pass lcp-echo-failure 0 on the PPP command line.  If we didn't do that, and if 'lcp-echo-failure 3' was in /etc/ppp/options, then pppd would use the value from /etc/ppp/options instead.

That's the basic problem here.  We can't control what's in /etc/ppp/options, and that file's effects are global to *all* connections, but in reality these options should be specific to each connection.  Each connection may have different requirements (different LCP options, perhaps some use CHAP instead of PAP, etc) but /etc/ppp/options doesn't account for that.  And unfortunately there's no way to make pppd *not* read /etc/ppp/options.

One complication here is that default values aren't written to keyfiles.  So I think the libnm-util patch might change NM behavior for existing GSM/CDMA users, but not for PPPoE users (due to pppoe_fill_defaults).  Since the previous values aren't in the keyfiles, what used to be zero will now be interpreted as 3 (for echo interval) and 20 (for echo failure) and that would be a behavior change.

So what I think should happen here is to just change pppoe_fill_defaults() like the patch does: don't set default values for those.  Instead, fill the default values in mm-modem-cdma.c and mm-modem-gsm.c's complete_connection() handlers, and have the applet/editor set the defaults for PPPoE connections too.  But since the bits from pppoe_fill_defaults would be removed, it would now be possible to disable LCP echo behavior.  That would also have the side-effect of disabling it for all PPPoE users unless they go into the editor and change it again but that may be something we just have to put into release notes.
Comment 10 Jiri Klimes 2011-12-07 17:06:30 UTC
Did you mean something like the following patches?

Note, I use values 5 and 30 as they are already in page-ppp.c:ui_to_setting()
Comment 11 Jiri Klimes 2011-12-07 17:08:38 UTC
Created attachment 203010 [details] [review]
set defaults in modems' connection complete
Comment 12 Jiri Klimes 2011-12-07 17:09:34 UTC
Created attachment 203011 [details] [review]
Set default when creating PPP setting in editor
Comment 13 Dan Williams 2012-01-14 16:04:38 UTC
Review of attachment 203010 [details] [review]:

Looks good.
Comment 14 Dan Williams 2012-01-14 16:04:53 UTC
Review of attachment 203011 [details] [review]:

Looks good.
Comment 15 Dan Williams 2012-01-14 16:05:22 UTC
Good to commit to master and 0.8, thanks.
Comment 16 Jiri Klimes 2012-01-16 12:21:13 UTC
Pushed.

master commits:
aed37465be287ff2c0f6aa061ae0ea97cf0b559b - NM
11c19e391e836de4fe122e62e22a0fcf5ce76a66 - editor

0.8.x commits:
249af870c952288ec970263cd0cfa545dfe4784b - NM
01030b18b9ddb7e9985fdd8112a82d43c03b9b44 - editor
Comment 17 Jiri Klimes 2012-05-28 12:55:52 UTC
The patch that set defaults to PPP setting lcp-* properties was not correct. We have to set the values in dsl_connection_new() instead of ce_page_ppp_new().
dsl_connection_new() is only called for new connections and is the proper place to initialize the properties. ce_page_ppp_new() is called each time a connection is edited and thus incorrectly affected the lcp-* values for connections that was missing a PPP connection due to having all PPP setting values default.

Fixed (in editor):
0e013c9f9d754390e6db05627631a6e19da670a5 (master)
cecb12d6f07235fd24a06be9fe2f632ba6c5076d (NMA_0_8)