Commit Graph

21088 Commits

Author SHA1 Message Date
Thomas Haller
c930b7b4fe platform: silence error reading sysctl for non existing device
https://bugzilla.gnome.org/show_bug.cgi?id=770378
2016-08-25 15:38:28 +02:00
Thomas Haller
2a314557c7 release: bump version to 1.5.1-dev after 1.4.0 release
After 1.4.0 is released, merge it back into master so that
1.4.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.4.0 and 1.4.0-rc1.

Also, the closest branch parent of master and nm-1-4 branch
becomes 1.4.0 tag.

Also bump the micro version to 1.5.1-dev to indicate that this is
after 1.4.0 is out, otherwise `git describe` uses the 1.4.0 tag.
2016-08-25 14:58:06 +02:00
Lubomir Rintel
93b4119a81 release: bump version to 1.4.0 2016-08-24 18:48:19 +02:00
Beniamino Galvani
2a56c07092 dhcp/systemd: honor timeout for DHCPv6
https://bugzilla.gnome.org/show_bug.cgi?id=770329
(cherry picked from commit bdaa3acfc3)
2016-08-24 18:01:18 +02:00
Beniamino Galvani
bdaa3acfc3 dhcp/systemd: honor timeout for DHCPv6
https://bugzilla.gnome.org/show_bug.cgi?id=770329
2016-08-24 18:00:06 +02:00
Lubomir Rintel
afab2b8112 cli: only connect handlers for property changes in interactive edit
Fixes: c5324ed285
(cherry picked from commit 79c81bbb8c)
2016-08-24 17:27:55 +02:00
Lubomir Rintel
2f45665559 cli: default to method=manual when adding an address
This restores accidentally changed behavior for
"nmcli c add ... ip[46] <address>"

Fixes: c5324ed285
(cherry picked from commit 195ad4ec97)
2016-08-24 17:27:55 +02:00
Lubomir Rintel
79c81bbb8c cli: only connect handlers for property changes in interactive edit
Fixes: c5324ed285
2016-08-24 17:22:54 +02:00
Lubomir Rintel
195ad4ec97 cli: default to method=manual when adding an address
This restores accidentally changed behavior for
"nmcli c add ... ip[46] <address>"

Fixes: c5324ed285
2016-08-24 17:22:54 +02:00
Thomas Haller
890c37ebd0 team: merge branch 'th/team-invalid-config-rh1366300'
https://bugzilla.redhat.com/show_bug.cgi?id=1366300

(cherry picked from commit eb982b9d94)
2016-08-24 11:00:02 +02:00
Thomas Haller
5b9f7169ed libnm-core/team: normalize invalid config to NULL
A user may very well have connections on disk with bogus json.
Such connections may have failed to activate before, but rejecting
them now as invalid means that we stop loading them from disk. That is,
they disappear after upgrade.

Instead of doing that, also accept invalid json (beside "") and
normalize/coerce it to NULL.

https://bugzilla.redhat.com/show_bug.cgi?id=1366300
(cherry picked from commit 476810c290)
2016-08-24 10:59:39 +02:00
Lubomir Rintel
5f1662066d libnm-core/team: treat "" team config as no config
https://bugzilla.redhat.com/show_bug.cgi?id=1366300
(cherry picked from commit 0fc8b856c3)
2016-08-24 10:59:39 +02:00
Thomas Haller
9382fb0213 device/team: fix assuming non-NULL team-config in NMDeviceTeam::act_stage1_prepare()
(cherry picked from commit 4f6fd1bf0e)
2016-08-24 10:59:39 +02:00
Thomas Haller
eb982b9d94 team: merge branch 'th/team-invalid-config-rh1366300'
https://bugzilla.redhat.com/show_bug.cgi?id=1366300
2016-08-24 10:58:41 +02:00
Thomas Haller
476810c290 libnm-core/team: normalize invalid config to NULL
A user may very well have connections on disk with bogus json.
Such connections may have failed to activate before, but rejecting
them now as invalid means that we stop loading them from disk. That is,
they disappear after upgrade.

Instead of doing that, also accept invalid json (beside "") and
normalize/coerce it to NULL.

https://bugzilla.redhat.com/show_bug.cgi?id=1366300
2016-08-24 10:58:02 +02:00
Lubomir Rintel
0fc8b856c3 libnm-core/team: treat "" team config as no config
https://bugzilla.redhat.com/show_bug.cgi?id=1366300
2016-08-24 10:57:54 +02:00
Thomas Haller
4f6fd1bf0e device/team: fix assuming non-NULL team-config in NMDeviceTeam::act_stage1_prepare() 2016-08-24 10:30:34 +02:00
Thomas Haller
07e8ddbfd8 NEWS: update
(cherry picked from commit 0a04b55491)
2016-08-23 22:52:28 +02:00
Thomas Haller
0a04b55491 NEWS: update 2016-08-23 22:46:35 +02:00
Thomas Haller
965df5c571 NEWS: fix spelling
(cherry picked from commit 154c86efc6)
2016-08-23 22:44:24 +02:00
Thomas Haller
154c86efc6 NEWS: fix spelling 2016-08-23 22:43:50 +02:00
Lubomir Rintel
aa0ebcc324 tests: try to resolve the .so file symbols
At some point, linker on ppc64le would throw away useful symbols along with the
garbage: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b

Add a post-build check so that the distributors running broken binutils
would catch this early and fix their toolchain (or disable the garbage
collecting at the expense of larger and slower binaries).

(cherry picked from commit 680b3d1037)
2016-08-23 14:32:43 +02:00
Lubomir Rintel
680b3d1037 tests: try to resolve the .so file symbols
At some point, linker on ppc64le would throw away useful symbols along with the
garbage: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1c9177d9a5c3e06d3344347c8068acfb7d8ecc8b

Add a post-build check so that the distributors running broken binutils
would catch this early and fix their toolchain (or disable the garbage
collecting at the expense of larger and slower binaries).
2016-08-23 14:32:13 +02:00
Thomas Haller
633344bf27 core: use #define for "rfkill-changed" signal name
(cherry picked from commit 640fbec855)
2016-08-23 11:46:28 +02:00
Thomas Haller
640fbec855 core: use #define for "rfkill-changed" signal name 2016-08-23 11:46:13 +02:00
Beniamino Galvani
772a9cb05d core: check valid uid for D-Bus load_connection(s)/set_logging calls
Commit 4c7fa8dfdc ("core: drop root requirement for
load_connection(s)/set_logging D-Bus calls") removed the enforcing of
permission in the daemon for such methods since the D-Bus daemon
configuration already does that. That change also allows clients to
send a request and not wait for a response, since we don't have to
check the caller credentials in the daemon.

In the future we might switch to polkit for these methods, breaking
clients that don't wait for a reponse, so it seems better to prevent
from beginning such behavior.

Fixes: 4c7fa8dfdc
(cherry picked from commit dd27b79c4e)
2016-08-23 11:24:19 +02:00
Beniamino Galvani
dd27b79c4e core: check valid uid for D-Bus load_connection(s)/set_logging calls
Commit 4c7fa8dfdc ("core: drop root requirement for
load_connection(s)/set_logging D-Bus calls") removed the enforcing of
permission in the daemon for such methods since the D-Bus daemon
configuration already does that. That change also allows clients to
send a request and not wait for a response, since we don't have to
check the caller credentials in the daemon.

In the future we might switch to polkit for these methods, breaking
clients that don't wait for a reponse, so it seems better to prevent
from beginning such behavior.

Fixes: 4c7fa8dfdc
2016-08-23 11:23:26 +02:00
Thomas Haller
847133c66c core: merge branch 'th/vpn-ifindex-fix-rh1368354'
https://bugzilla.redhat.com/show_bug.cgi?id=1368354

(cherry picked from commit 224d383595)
2016-08-23 11:12:53 +02:00
Thomas Haller
0852401b0e vpn: ignore unexpected default-route for nm_vpn_connection_ip6_config_get()
The VPN data comes from an external source, it may be bogus.
Default-routes are not allowed on this point and would trigger
an assertion afterwards. Skip over them.

(cherry picked from commit 071103b172)
2016-08-23 11:12:10 +02:00
Thomas Haller
6757dd3713 vpn: fix nm_vpn_connection_ip6_config_get() for VPNs without own interface
We need an ifindex for the NMIP4Config/NMIP6Config instance.
For interface-less VPN types, we need to lookup the parent
device, as already done for IPv4.

Fix IPv6 case too.

https://bugzilla.redhat.com/show_bug.cgi?id=1368354
(cherry picked from commit 2da35ddfe8)
2016-08-23 11:12:10 +02:00
Thomas Haller
bf1713a701 vpn: refactor property implementation in NMVpnConnection
(cherry picked from commit 9d6f613df4)
2016-08-23 11:12:10 +02:00
Thomas Haller
907b5a597e vpn: embed private data in NMVpnConnection structure
(cherry picked from commit d52195475b)
2016-08-23 11:12:10 +02:00
Thomas Haller
02980bed49 core: downgrade assertion in nm-ip[46]-config.c to g_critical
(cherry picked from commit c5682d601b)
2016-08-23 11:12:10 +02:00
Thomas Haller
224d383595 core: merge branch 'th/vpn-ifindex-fix-rh1368354'
https://bugzilla.redhat.com/show_bug.cgi?id=1368354
2016-08-23 11:11:27 +02:00
Thomas Haller
071103b172 vpn: ignore unexpected default-route for nm_vpn_connection_ip6_config_get()
The VPN data comes from an external source, it may be bogus.
Default-routes are not allowed on this point and would trigger
an assertion afterwards. Skip over them.
2016-08-23 10:51:18 +02:00
Thomas Haller
2da35ddfe8 vpn: fix nm_vpn_connection_ip6_config_get() for VPNs without own interface
We need an ifindex for the NMIP4Config/NMIP6Config instance.
For interface-less VPN types, we need to lookup the parent
device, as already done for IPv4.

Fix IPv6 case too.

https://bugzilla.redhat.com/show_bug.cgi?id=1368354
2016-08-23 10:51:18 +02:00
Thomas Haller
9d6f613df4 vpn: refactor property implementation in NMVpnConnection 2016-08-23 10:51:18 +02:00
Thomas Haller
d52195475b vpn: embed private data in NMVpnConnection structure 2016-08-23 10:51:18 +02:00
Thomas Haller
c5682d601b core: downgrade assertion in nm-ip[46]-config.c to g_critical 2016-08-23 10:51:18 +02:00
Thomas Haller
417039fbd6 device: silence logging about "link disconnected"
<info> logging is just too verbose for something that happens
frequently.

(cherry picked from commit ed7f832c40)
2016-08-23 10:50:49 +02:00
Thomas Haller
f392da2c78 device: fix queued activation failure due to link disconnected
When activating a connection, it may fail with nmcli reporting:
  $ nmcli connection up id "Wired Connection 1"
  Error: Connection activation failed: Active connection removed before it was initialized

This should be easily reproducible by having a connection "Wired Connection 1" with
cloned-mac-address set to random. When the connection is already active on a device,
re-activating with
  $ nmcli connection up id "Wired Connection 1"
fails.

We first create a queued-activation and tear down the existing
connection:
   device (enp0s25): state change: deactivating -> disconnected (reason 'new-activation')
Shortly after we see:
   device[0x557d02cdb0c0] (enp0s25): set-hw-addr: setting MAC address to 'AA:BB:CC:DD:EE:FF' (reset, deactivate)...
   device[0x557d02cdb0c0] (enp0s25): taking down device
later, we get:
   device (enp0s25): link disconnected
   device[0x557d02cdb0c0] (enp0s25): queued state change to unavailable due to carrier-changed (id 17290)
in the meantime, the queued activation request starts:
   device (enp0s25): Activation: starting connection 'my-wired' (ca058ec5-8a47-4e1e-b38e-962b71c4699e)
but the device already transitions to unavailable
   device[0x557d02cdb0c0] (enp0s25): running queued state change to unavailable (id 17290)
   device (enp0s25): state change: disconnected -> unavailable (reason 'carrier-changed') [30 20 40]
which kills the new activation request:
   active-connection[0x557d02c10e40]: set state deactivated (was unknown)

Just delay a carrier-lost handling if we have any queued activation
requests.

(cherry picked from commit d4e9b30320)
2016-08-23 10:50:48 +02:00
Thomas Haller
ed7f832c40 device: silence logging about "link disconnected"
<info> logging is just too verbose for something that happens
frequently.
2016-08-23 10:44:43 +02:00
Thomas Haller
d4e9b30320 device: fix queued activation failure due to link disconnected
When activating a connection, it may fail with nmcli reporting:
  $ nmcli connection up id "Wired Connection 1"
  Error: Connection activation failed: Active connection removed before it was initialized

This should be easily reproducible by having a connection "Wired Connection 1" with
cloned-mac-address set to random. When the connection is already active on a device,
re-activating with
  $ nmcli connection up id "Wired Connection 1"
fails.

We first create a queued-activation and tear down the existing
connection:
   device (enp0s25): state change: deactivating -> disconnected (reason 'new-activation')
Shortly after we see:
   device[0x557d02cdb0c0] (enp0s25): set-hw-addr: setting MAC address to 'AA:BB:CC:DD:EE:FF' (reset, deactivate)...
   device[0x557d02cdb0c0] (enp0s25): taking down device
later, we get:
   device (enp0s25): link disconnected
   device[0x557d02cdb0c0] (enp0s25): queued state change to unavailable due to carrier-changed (id 17290)
in the meantime, the queued activation request starts:
   device (enp0s25): Activation: starting connection 'my-wired' (ca058ec5-8a47-4e1e-b38e-962b71c4699e)
but the device already transitions to unavailable
   device[0x557d02cdb0c0] (enp0s25): running queued state change to unavailable (id 17290)
   device (enp0s25): state change: disconnected -> unavailable (reason 'carrier-changed') [30 20 40]
which kills the new activation request:
   active-connection[0x557d02c10e40]: set state deactivated (was unknown)

Just delay a carrier-lost handling if we have any queued activation
requests.
2016-08-23 10:43:12 +02:00
Thomas Haller
6c4447520d platform: disable debug logging for NMPObject ref-couting
These logging lines are already disabled by default as _LOGt()
is a NOP unless configured --with-more-logging.

However, the logging is still very verbose also for debug-builds
and currently there are no known issues there. Disable the logging
statements (but leave them in so they can easily be enabled).

(cherry picked from commit 4cb845558e)
2016-08-22 18:37:04 +02:00
Thomas Haller
4cb845558e platform: disable debug logging for NMPObject ref-couting
These logging lines are already disabled by default as _LOGt()
is a NOP unless configured --with-more-logging.

However, the logging is still very verbose also for debug-builds
and currently there are no known issues there. Disable the logging
statements (but leave them in so they can easily be enabled).
2016-08-22 18:34:44 +02:00
Thomas Haller
f1beb01050 core: use define for signal name in nm_active_connection_set_device()
(cherry picked from commit 598bea3481)
2016-08-22 16:25:33 +02:00
Thomas Haller
0e1c7ede12 device: emit NM_DEVICE_STATE_CHANGED signal by id
This saves a lookup of the ID by name. We already have the signal-id,
use it.

(cherry picked from commit 534b0360c1)
2016-08-22 16:25:32 +02:00
Thomas Haller
598bea3481 core: use define for signal name in nm_active_connection_set_device() 2016-08-22 13:45:04 +02:00
Thomas Haller
534b0360c1 device: emit NM_DEVICE_STATE_CHANGED signal by id
This saves a lookup of the ID by name. We already have the signal-id,
use it.
2016-08-22 13:42:19 +02:00
Beniamino Galvani
e9f96024ae cli: return sane error message for D-Bus policy permission errors
The error returned to users when a load_connection(s)/set_logging call
fails due to D-Bus policy denial is a bit obscure:

  $ nmcli general logging level debug
  Error: failed to set logging: Rejected send message, 4 matched rules;
  type="method_call", sender=":1.233" (uid=1001 pid=27225 comm="nmcli
  general logging level debug ")
  interface="org.freedesktop.NetworkManager" member="SetLogging" error
  name="(unset)" requested_reply="0" destination=":1.207" (uid=0
  pid=25793 comm="/usr/sbin/NetworkManager --no-daemon ")

Convert it to a more comprehensible:

  $ nmcli general logging level debug
  Error: failed to set logging: access denied

https://bugzilla.redhat.com/show_bug.cgi?id=1362542
(cherry picked from commit 805925f9ef)
2016-08-20 10:45:55 +02:00