<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/ppp/nm-pppd-plugin.c, branch th/fix-python-test</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>all: SPDX header conversion</title>
<updated>2019-09-10T09:19:56+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2019-09-10T09:19:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=24028a22467275671df71cc6a8054036b37d8f03'/>
<id>24028a22467275671df71cc6a8054036b37d8f03</id>
<content type='text'>
  $ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  $ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
</pre>
</div>
</content>
</entry>
<entry>
<title>core/pppd-plugin: wait to recover port settings before notifying death</title>
<updated>2019-06-14T11:29:45+00:00</updated>
<author>
<name>Alfonso Sánchez-Beato</name>
<email>alfonso.sanchez-beato@canonical.com</email>
</author>
<published>2019-06-13T16:23:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a251712a729f676c9c2d38e469e4f88e250229ba'/>
<id>a251712a729f676c9c2d38e469e4f88e250229ba</id>
<content type='text'>
pppd restores the previous settings for the serial port it uses right
before exiting. It is especially important to do so because otherwise
ModemManager is not able to recover the port as it can receive a hangup
event from the port due to CLOCAL not being restored.  However, there is
currently a race condition that produces this issue. This is because
when PHASE_DEAD is notified, pppd still has not restored the port
settings - it does that a bit later, in the die() function.

This patch delays notifying PHASE_DEAD until when the exitnotify() hook
is called by pppd: when this happens the port settings have already been
restored.

There were previously efforts to fix this in commit fe090c34b724, so
PHASE_DEAD was used instead of PHASE_DISCONNECT to notify MM that the
port was disconnected, but that still early to ensure that the port
settings are restored.

The MM traces seen when the bug is triggered are:

ModemManager[2158]: &lt;warn&gt;  (ttyACM1): could not re-acquire serial port lock: (5) Input/output error
ModemManager[2158]: &lt;warn&gt;  Couldn't load Operator Code: 'Cannot run sequence: 'Could not open serial device ttyACM1: it has been forced close'

https://mail.gnome.org/archives/networkmanager-list/2019-June/msg00014.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pppd restores the previous settings for the serial port it uses right
before exiting. It is especially important to do so because otherwise
ModemManager is not able to recover the port as it can receive a hangup
event from the port due to CLOCAL not being restored.  However, there is
currently a race condition that produces this issue. This is because
when PHASE_DEAD is notified, pppd still has not restored the port
settings - it does that a bit later, in the die() function.

This patch delays notifying PHASE_DEAD until when the exitnotify() hook
is called by pppd: when this happens the port settings have already been
restored.

There were previously efforts to fix this in commit fe090c34b724, so
PHASE_DEAD was used instead of PHASE_DISCONNECT to notify MM that the
port was disconnected, but that still early to ensure that the port
settings are restored.

The MM traces seen when the bug is triggered are:

ModemManager[2158]: &lt;warn&gt;  (ttyACM1): could not re-acquire serial port lock: (5) Input/output error
ModemManager[2158]: &lt;warn&gt;  Couldn't load Operator Code: 'Cannot run sequence: 'Could not open serial device ttyACM1: it has been forced close'

https://mail.gnome.org/archives/networkmanager-list/2019-June/msg00014.html
</pre>
</div>
</content>
</entry>
<entry>
<title>all: drop emacs file variables from source files</title>
<updated>2019-06-11T08:04:00+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-06-02T12:32:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c0e075c90263150bd00ea033dbbd2d8e6b05300e'/>
<id>c0e075c90263150bd00ea033dbbd2d8e6b05300e</id>
<content type='text'>
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
</pre>
</div>
</content>
</entry>
<entry>
<title>core/pppd-plugin: use GDBusConnection in "nm-pppd-plugin.c"</title>
<updated>2019-05-13T07:25:05+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-05-05T13:00:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=156f4ee53f0e8007344f68d513bb13958facd72f'/>
<id>156f4ee53f0e8007344f68d513bb13958facd72f</id>
<content type='text'>
- use GDBusConnection instead of GDBusProxy.

- namespace global variables with a "gl" struct.

- don't log __func__. If a log line should have a certain
  topic/tag, the tag should be set manually, not based on the
  function name. It just looks odd. Also, it's unnecessary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- use GDBusConnection instead of GDBusProxy.

- namespace global variables with a "gl" struct.

- don't log __func__. If a log line should have a certain
  topic/tag, the tag should be set manually, not based on the
  function name. It just looks odd. Also, it's unnecessary.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: drop unnecessary includes of &lt;errno.h&gt; and &lt;string.h&gt;</title>
<updated>2019-02-12T07:50:28+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2019-01-31T12:44:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a3370af3a8a965e41950c5022182730d79614df2'/>
<id>a3370af3a8a965e41950c5022182730d79614df2</id>
<content type='text'>
"nm-macros-interal.h" already includes &lt;errno.h&gt; and &lt;string.h&gt;.
No need to include it everywhere else too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"nm-macros-interal.h" already includes &lt;errno.h&gt; and &lt;string.h&gt;.
No need to include it everywhere else too.
</pre>
</div>
</content>
</entry>
<entry>
<title>ppp: check ppp status against correct type</title>
<updated>2018-10-22T08:53:16+00:00</updated>
<author>
<name>Sven Schwermer</name>
<email>sven.schwermer@disruptive-technologies.com</email>
</author>
<published>2018-10-22T07:54:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1913a4d2590d42413b04c0cf86321286bb2e2dbd'/>
<id>1913a4d2590d42413b04c0cf86321286bb2e2dbd</id>
<content type='text'>
ppp_status is of type NMPPPStatus whereas PHASE_RUNNING is pppd's type.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/28
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ppp_status is of type NMPPPStatus whereas PHASE_RUNNING is pppd's type.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/28
</pre>
</div>
</content>
</entry>
<entry>
<title>ppp: avoid strncpy() in ppp plugin nm_phasechange()</title>
<updated>2018-09-12T07:46:28+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2018-09-11T19:53:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=2f6af40cd5fdd3cd1cf2ba825b9a1e9beccb9381'/>
<id>2f6af40cd5fdd3cd1cf2ba825b9a1e9beccb9381</id>
<content type='text'>
strncpy() is deemed insecure, and it raises at least an eyebrow.
While it's save in this case, just avoid it.

(cherry picked from commit 4d11eba8c59b6dc00a0cc4b644104b19873699c9)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
strncpy() is deemed insecure, and it raises at least an eyebrow.
While it's save in this case, just avoid it.

(cherry picked from commit 4d11eba8c59b6dc00a0cc4b644104b19873699c9)
</pre>
</div>
</content>
</entry>
<entry>
<title>ppp/plugin: use g_strlcpy()</title>
<updated>2018-02-12T19:46:47+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2018-02-12T17:42:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=85c0dc4a92f036df7e332e8c4deaaae78575e294'/>
<id>85c0dc4a92f036df7e332e8c4deaaae78575e294</id>
<content type='text'>
It's nicer but also doesn't annoy gcc 8: "error: ‘strncpy’ specified bound
depends on the length of the source argument [-Werror=stringop-overflow=]"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's nicer but also doesn't annoy gcc 8: "error: ‘strncpy’ specified bound
depends on the length of the source argument [-Werror=stringop-overflow=]"
</pre>
</div>
</content>
</entry>
<entry>
<title>all: require glib 2.40</title>
<updated>2018-01-18T10:45:36+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2018-01-02T14:47:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=8a46b25cfa8c33daa8af37bb8103ca02286001b1'/>
<id>8a46b25cfa8c33daa8af37bb8103ca02286001b1</id>
<content type='text'>
RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
</pre>
</div>
</content>
</entry>
<entry>
<title>ppp: update interface name in the plugin after NM changes it</title>
<updated>2018-01-10T14:36:29+00:00</updated>
<author>
<name>Beniamino Galvani</name>
<email>bgalvani@redhat.com</email>
</author>
<published>2018-01-08T16:03:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=398f9105b49e1c44389462533a53b5a11cc94eca'/>
<id>398f9105b49e1c44389462533a53b5a11cc94eca</id>
<content type='text'>
When NM knows of the ifindex/name of the new PPP interface (through
the SetIfindex() call), it renames it. This can race with the pppd
daemon, which issues ioctl() using the interface name cached in the
global 'ifname' variable:

  ...
  NetworkManager[27213]: &lt;debug&gt; [1515427406.0036] ppp-manager: set-ifindex 71
  pppd[27801]: sent [CCP ConfRej id=0x1 &lt;deflate 15&gt; &lt;deflate(old#) 15&gt; &lt;bsd v1 15&gt;]
  NetworkManager[27213]: &lt;debug&gt; [1515427406.0036] platform: link: setting 'ppp5' (71) name dsl-ppp
  pppd[27801]: sent [IPCP ConfAck id=0x2 &lt;addr 3.1.1.1&gt;]
  pppd[27801]: ioctl(SIOCSIFADDR): No such device (line 2473)
  pppd[27801]: Interface configuration failed
  pppd[27801]: Couldn't get PPP statistics: No such device
  ...

Fortunately the variable is exposed to plugins and so we can turn the
SetIfindex() D-Bus call into a synchronous one and then update the
value of the 'ifname' global variable with the new interface name
assigned by NM.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When NM knows of the ifindex/name of the new PPP interface (through
the SetIfindex() call), it renames it. This can race with the pppd
daemon, which issues ioctl() using the interface name cached in the
global 'ifname' variable:

  ...
  NetworkManager[27213]: &lt;debug&gt; [1515427406.0036] ppp-manager: set-ifindex 71
  pppd[27801]: sent [CCP ConfRej id=0x1 &lt;deflate 15&gt; &lt;deflate(old#) 15&gt; &lt;bsd v1 15&gt;]
  NetworkManager[27213]: &lt;debug&gt; [1515427406.0036] platform: link: setting 'ppp5' (71) name dsl-ppp
  pppd[27801]: sent [IPCP ConfAck id=0x2 &lt;addr 3.1.1.1&gt;]
  pppd[27801]: ioctl(SIOCSIFADDR): No such device (line 2473)
  pppd[27801]: Interface configuration failed
  pppd[27801]: Couldn't get PPP statistics: No such device
  ...

Fortunately the variable is exposed to plugins and so we can turn the
SetIfindex() D-Bus call into a synchronous one and then update the
value of the 'ifname' global variable with the new interface name
assigned by NM.
</pre>
</div>
</content>
</entry>
</feed>
