Commit graph

8346 commits

Author SHA1 Message Date
Beniamino Galvani
fc56eff0ae settings: fix assertion when changing connection managed state
When a ifcfg-rh connection becomes unamanaged it is removed from the
connection list in NMSettings and marked as removed; it is however
kept alive in the plugin and can become managed again later. To avoid
failed assertions, the @removed flag of the NMSettingsConnection must
be cleared if the connection is not being disposed.

(cherry picked from commit a9384452ed)
2017-01-10 14:28:14 +01:00
Beniamino Galvani
48db5806f3 vpn: add device route to VPN gateway if parent has no gateway
We set a dedicated route to reach the VPN gateway only if the parent
device has a gateway. If the parent device doesn't have a gateway (for
example in case of GSM connections) and the VPN gets the default
route, the VPN gateway will be contacted through the VPN itself, which
obviously doesn't work.

Set up a device route if the parent device doesn't provide a gateway.

https://bugzilla.redhat.com/show_bug.cgi?id=1403660
(cherry picked from commit ae5adc9e21)
2017-01-07 15:07:29 +01:00
Lubomir Rintel
479a64a5b7 device: avoid a crash when L3 configuration fails
Don't call the IP check until at either IPv4 or IPv6 is actually
configured.

(cherry picked from commit aa71dbc6c4)
2017-01-05 09:39:41 +01:00
Dan Williams
28cd59a016 wifi: don't request new PSK for locally-generated WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY errors
This usually indicates that the driver missed beacons from the AP, due to driver bugs
or faulty power-save management.  It doesn't mean that the PSK is wrong.

(cherry picked from commit 0c5aa6e48b)
2016-12-20 10:07:12 -06:00
Thomas Haller
f0d20c945e all: use O_CLOEXEC for file descriptors
(cherry picked from commit 4bdee37771)
2016-12-15 17:52:33 +01:00
Thomas Haller
fea11a91a3 platform: refactor nmp_utils_sysctl_open_netdir()
- use nm_auto_close cleanup attribute
- optionally, return the found ifname
- don't stat "phy80211". If such an entity can be opened,
  just assume it's a directory.

(cherry picked from commit 76876e896c)
2016-12-15 17:52:33 +01:00
Kai-Heng Feng
e196ff7553 platform: wifi: use nmp_utils_open_sysctl() to check if device is wifi
Since function nmp_utils_open_sysctl() can avoid race condition, use it
in wifi_utils_is_wifi() to open sysfs and correctly check if it's a wifi
device.

https://bugzilla.gnome.org/show_bug.cgi?id=775613
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
(cherry picked from commit b95556eb78)
2016-12-15 17:52:33 +01:00
Kai-Heng Feng
8705a16d48 platform: add a new function nmp_utils_open_sysctl()
A race condition may happen when NetworkManager opens sysfs and udev
renames interface name at the same time. Thomas Haller provides a new
function [1] which can avoid the race condition when opening sysfs.

This patch is a direct copy from [1].

[1] https://mail.gnome.org/archives/networkmanager-list/2016-December/msg00004.html

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
(cherry picked from commit 713c74f6e4)
2016-12-15 17:52:32 +01:00
Thomas Haller
f16a9a2299 device/wwan: use nm_auto_close instead of gs_fd_close
(cherry picked from commit ed299cc860)
2016-12-15 17:52:32 +01:00
Beniamino Galvani
c7167c9088 manager: don't upgrade the state when connectivity check fails
If a connection is ACTIVATED and another one is ACTIVATING but there
is no global connectivity, we currently set the manager state to
CONNECTING and start a connectivity check to verify whether the
manager state can be promoted to CONNECTED_GLOBAL.

If this connectivity check fails, we shouldn't promote a CONNECTING
state to CONNECTED_SITE.

Fixes: 084da69a30
(cherry picked from commit 7375822c95)
2016-12-14 10:21:53 +01:00
Beniamino Galvani
151dbe10b1 manager: don't update the manager state in get_property()
The manager state is already computed every time an active connection
changes state, it is not necessary to call nm_manager_update_state()
also when the property is read.

Moreover, nm_manager_update_state() emits a "notify::state" signal
which causes a re-read of the property by the nm-exported-object,
resulting in a nested execution of nm_manager_update_state().

(cherry picked from commit 4cc45ee291)
2016-12-14 10:21:50 +01:00
Beniamino Galvani
2ea42eee5a ip6-config: sort addresses only when reading the property value
Don't change the address order from configuration, but instead sort
addresses just before returning them to clients.

(cherry picked from commit 0a0bca9c7f)
2016-12-09 14:30:57 +01:00
Beniamino Galvani
450572cff4 ip6-config: add nm_ip6_config_set_privacy()
(cherry picked from commit 803a79f778)
2016-12-09 14:30:46 +01:00
Beniamino Galvani
6633eaf75c ip6-config: cache addresses variants
(cherry picked from commit ed4d5889c7)
2016-12-09 14:18:58 +01:00
Beniamino Galvani
6fdea664a4 ip4-config: sort addresses only when reading the property value
Don't change the address order from configuration, but instead sort
addresses just before returning them to clients.

(cherry picked from commit 9609d4da1d)
2016-12-09 14:18:56 +01:00
Beniamino Galvani
996f325f67 ip4-config: cache addresses variants
(cherry picked from commit 5ce81e23b7)
2016-12-09 14:18:54 +01:00
Beniamino Galvani
56cebecd41 ip4-config: don't change order of addresses in the same subnet
When multiple address are assigned to an interface and the kernel must
decide which one should be used to communicate with a given IP, it
chooses the most specific one in the same subnet as the
destination. In case there are multiple addresses in the same subnet,
the primary address is choosen, which is basically the first one that
was added.

With commit 7197425137 ("device: expose NMIP4Config:addresses in
stable/defined sort order") we sorted all the addresses before
committing the configuration, with the side effect that the order no
longer respected the one in the user configuration.

Instead, change the sort function to keep the subnet order unchanged.

(cherry picked from commit e02752c2ed)
2016-12-09 14:18:53 +01:00
Thomas Haller
8bcf1a6e3d ip-config: cleanup integer types for nm_ip4_config_get_num_*()
(cherry picked from commit 510626bf74)
2016-12-09 14:18:47 +01:00
Thomas Haller
baac746abb device: fix activation_source_schedule() for rescheduling the same function
Fixes: 78ca961c0f
(cherry picked from commit 994f1ca96e)
2016-12-08 13:56:21 +01:00
Thomas Haller
5f2b0abdd2 platform: increase initial buffer size of libnl's nl_recvmsg() to 32K
Since commit 9fafb382db, we would
explicitly set libnl's socket buffer size to 4*getpagesize().
That is also the default of libnl itself. Additionally, we would
workaround too small buffers by increasing the buffer size up to 512K.

A too small buffer causes messages to be lost. Usually, that only
results in a cache-resync, which isn't too bad. Lost messages are however
a problem if the lost message was an ACK that we were waiting for.
However, it is rather unlikely to happen, because it's expected that
the buffer size gets adjusted already when the cache is filled initially,
before any other requests are pending.

Still, let's increase the default buffer size to 32K, hoping that this
initial value is already large enough to avoid the problem altogether.

Note that iproute2 also uses a buffer size of 32K [1] [2].

Alternatively, we could use MSG_PEEK like systemd does [3]. However,
that requires two syscalls per message.

[1] https://patchwork.ozlabs.org/patch/592178/
[2] https://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tree/lib/libnetlink.c?id=f5f760b81250630da23a4021c30e802695be79d2#n274
[3] cd66af2274/src/libsystemd/sd-netlink/netlink-socket.c (L323)

(cherry picked from commit ed82b6bcb3)
2016-12-02 15:32:45 +01:00
Thomas Haller
74ff792956 device: allow device reapply of a connection with differing connection.autoconnect
Autoconnect property doesn't really matter for the applied
connection. Whitelist it from the properties and allow changing
it during reapply.

(cherry picked from commit d29839c430)
2016-12-02 11:43:28 +01:00
Thomas Haller
5dbd54552d platform: workaround NLE_MSG_TRUNC failure of nl_recv() with too small buffer size
We don't want to enable MSG_PEEK due to the overhead. But when we detect
that we just lost a message due to MSG_TRUNC, increase the buffer size and
retry.

See-also: 55ea6e6b6c
(cherry picked from commit 9fafb382db)
2016-11-30 17:23:00 +01:00
Lubomir Rintel
8ab9634fdb vpn-manager: ignore ip configs from disconnected plugins
Plugins could be already failed or disconnected when the helper fires.
E.g. they could send in an invalid IP4Config that would cause them to
fail and then follow with an IP6Config before they realize it's of no
use. We'd hit an assertion failure in that case, because the
NMVpnConnection would already be cleaned up.

(cherry picked from commit bf70ed2e86)
2016-11-24 14:18:47 +01:00
Lubomir Rintel
676d16293f wifi: notify the AccessPoint change after an AP is removed
Otherwise its path remains visible on D-Bus despite the object is gone,
making libnm sad and grumpy:

  libnm-WARNING **: no object known for /org/freedesktop/NetworkManager/AccessPoint/666

(cherry picked from commit d0c01cc79d)
2016-11-24 14:12:40 +01:00
Beniamino Galvani
ad4d3ba008 manager: fix state transition on resuming from sleep
When going to sleep, we unmanage devices setting the unmanaged flags
immediately but delaying the state transition (because we do it from
another state transition). The signal handler can be executed after
the wake and, especially, after we have already re-managed the device,
making the device unmanaged again.

Detect such situation and force the state to UNMANAGED (which will
also clear any pending state change), so that later we manage the
device again and it will try to activate any available connection.

Fixes: 81ea812362
(cherry picked from commit 3cc06c3db679c1ff2f61a301396393300d36adbb)
2016-11-24 14:12:33 +01:00
Beniamino Galvani
561a0a428d manager: force connectivity check when there is a default active connection
The interaction between the manager state and connectivity check code
is tricky. When there is an active connection with a default route and
NMConnectivity reports full connectivity, we set the CONNECTED_GLOBAL
state. However, if the connectivity check hasn't run yet, we stay in
CONNECTED_SITE state. If there are also other connections that are
activating, the state is set to CONNECTING.

This is a problem, because in CONNECTING we never run the connectivity
check and thus we fail to recognize that there is full connectivity
until a periodic check is run.

To solve this, schedule the connectivity check every time there is an
active connection with default route, even if other connection are
still activating, so that the check result can make the state progress
to CONNECTED_GLOBAL.

(cherry picked from commit 084da69a30)
2016-11-07 14:25:46 +01:00
Thomas Haller
37266b483b device: suppress log message in nm_device_update_hw_address() when no MAC address
For example for tun devices we get a lot of

  (tun7): hw-addr: failed reading current MAC address

warnings. Just be silent about it. We log when something
changes, we don't need to log when we fail to obtain
a MAC address.

Thereby, refactor nm_device_update_hw_address() to return early.

(cherry picked from commit 0e0018c801)

Conflicts:
    src/devices/nm-device.c
2016-11-03 12:24:02 +01:00
Thomas Haller
cc0a590d57 device: don't evaluate IP config changes until device is initialized
The unmanaged flags PLATFORM_INIT indicates whether UDEV is done
initializing the device. We should not handle IP config changes
before that pointer.

This avoids codepaths that require the permanent MAC address of the
device. We should not freeze the permanent MAC address before
UDEV initialized the device, for two reasons:

- getting the permanent MAC address using ethtool is racy as
  UDEV might still rename the interface.
- freezing a fake permanent MAC address should only happen after
  UDEV is done configuring the MAC address of software devices.

    #0  0x000055555568bc7a in nm_device_update_permanent_hw_address (self=self@entry=0x555555f0fb70 [NMDeviceVeth], force_freeze=force_freeze@entry=1) at src/devices/nm-device.c:11817
    #1  0x000055555568c443 in nm_device_get_permanent_hw_address_full (self=self@entry=0x555555f0fb70 [NMDeviceVeth], force_freeze=force_freeze@entry=1, out_is_fake=out_is_fake@entry=0x0)
        at src/devices/nm-device.c:12227
    #2  0x000055555568cb06 in nm_device_get_permanent_hw_address (self=self@entry=0x555555f0fb70 [NMDeviceVeth]) at src/devices/nm-device.c:12237
    #3  0x000055555568cb50 in spec_match_list (self=0x555555f0fb70 [NMDeviceVeth], specs=0x555555a5c000 = {...}) at src/devices/nm-device.c:12294
    #4  0x00005555556a4ee6 in spec_match_list (device=0x555555f0fb70 [NMDeviceVeth], specs=0x555555a5c000 = {...}) at src/devices/nm-device-ethernet.c:1461
    #5  0x00005555556978db in nm_device_spec_match_list (self=self@entry=0x555555f0fb70 [NMDeviceVeth], specs=0x555555a5c000 = {...}) at src/devices/nm-device.c:12277
    #6  0x000055555558e187 in _match_section_infos_lookup (match_section_infos=0x555555a5d500, keyfile=0x555555a46f80, property=property@entry=0x555555793123 "ipv4.route-metric", device=device@entry=0x555555f0fb70 [NMDeviceVeth], out_value=out_value@entry=0x7fffffffe018) at src/nm-config-data.c:1169
    #7  0x00005555555922ca in nm_config_data_get_connection_default (self=0x555555a548c0 [NMConfigData], property=property@entry=0x555555793123 "ipv4.route-metric", device=device@entry=0x555555f0fb70 [NMDeviceVeth]) at src/nm-config-data.c:1234
    #8  0x00005555556790cd in _get_ipx_route_metric (self=self@entry=0x555555f0fb70 [NMDeviceVeth], is_v4=is_v4@entry=1) at src/devices/nm-device.c:1142
    #9  0x000055555567912e in nm_device_get_ip4_route_metric (self=self@entry=0x555555f0fb70 [NMDeviceVeth]) at src/devices/nm-device.c:1161
    #10 0x000055555567da6c in ip4_config_merge_and_apply (self=self@entry=0x555555f0fb70 [NMDeviceVeth], config=config@entry=0x0, commit=commit@entry=0, out_reason=out_reason@entry=0x0)
        at src/devices/nm-device.c:4787
    #11 0x000055555567e0fb in update_ip4_config (self=self@entry=0x555555f0fb70 [NMDeviceVeth], initial=initial@entry=0) at src/devices/nm-device.c:9532
    #12 0x0000555555693acd in queued_ip4_config_change (user_data=0x555555f0fb70) at src/devices/nm-device.c:9651
    #13 0x00007ffff4c966ba in g_main_context_dispatch (context=0x555555a46af0) at gmain.c:3154
    #14 0x00007ffff4c966ba in g_main_context_dispatch (context=context@entry=0x555555a46af0) at gmain.c:3769
    #15 0x00007ffff4c96a70 in g_main_context_iterate (context=0x555555a46af0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
    #16 0x00007ffff4c96d92 in g_main_loop_run (loop=0x555555a47400) at gmain.c:4034
    #17 0x000055555558372a in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:411

(cherry picked from commit 31ca7962f8)
2016-11-03 12:24:02 +01:00
Thomas Haller
9f51a93d97 device: delay evaluating unmanaged-by-user-settings flags until link initialized
Before the link is initialized, that is before UDEV completed
initializing the device, we should not evaluate the user-settings
unmanaged flags.

The reason is, that evaluating it likely involves looking at the
permanent MAC address, which might use the wrong fake MAC address
(before UDEV set the right one). Also, it might use the wrong ifname
to lookup the permanent MAC address via ethtool.

(cherry picked from commit c0d249b733)
2016-11-03 12:24:02 +01:00
Thomas Haller
38b6f36edc device: delay capturing permanent MAC address until UDEV is settled
The permanent MAC address of an NMDevice shall not change as
long as the device is realized. That is, we read it only once
and don't change it afterwards.

There are two issues that this commit tries to mitigate:

(1) users are advised to use UDEV to rename interfaces. As we lookup
  the permenent MAC address using ethtool (which uses the interface
  name), there is a race where we could read the permanent MAC
  address using the wrong interface name. We should wait until
  UDEV finished initializing the device and until the interface
  name is stable (see rh#1388286).
  This commit still cannot avoid the race of ethtool entirely. It only
  tries to avoid ethtool until UDEV has done its work. That is, until we
  expect the interface name no longer to change.

(2) some device types, don't have a permanent MAC address so we fall
  back to use the currently set address (fake). Again, users are advised
  to use UDEV to configure the MAC addresses on such software devices.
  Thus, we should not get the fake MAC address until UDEV initialized
  the device.

This patch actually doesn't solve the problem at all yet.
The reason is that a regular caller of nm_device_get_permanent_hw_address() can
not afford to wait until UDEV settled. Thus, any user who requests the
permanent MAC address before the link is initialized, runs into the
problems above.

In a next step, we shall revisit such calls to nm_device_get_permanent_hw_address()
and delay them until the link is initialized.

(cherry picked from commit 7b7c653c4f)

Conflicts:
        src/devices/nm-device.c
        src/nm-manager.c
2016-11-03 12:24:01 +01:00
Thomas Haller
e41284b3fc device: don't allow mutating the device's hardware address length
We repeatedly call nm_device_update_hw_address() to reset the cached
MAC address of the device. However, we don't allow changing the address
length once it is set.

Multiple entities (initial, current and permanent MAC address) are all
checked to have the same address length. Changing the length would be a
very strange thing (and probably indicate a bug somewhere else).

Just don't allow that.

(cherry picked from commit cbea1f9f23)
2016-11-03 12:24:01 +01:00
Thomas Haller
7bb7b17408 device: treat fake permanent MAC address mostly like a real one
Now that we persist the fake permanent address across
restart of NetworkManager, we want to consider fake
addresses as good enough in most cases.

(cherry picked from commit 416164aa29)
2016-11-03 12:24:01 +01:00
Lubomir Rintel
bb5ee41dc4 config: allow fallback to fake permanent address for default wired connections
The default wired connection is already generated allowing the use of a fake
address, but for the state file and the device matching specs only non-fake
addresses are used. Let's allow fake addresses consistently, so that default
wired connections work properly in containers (where the veth address is
considered fake) as well.

Also, it would really be a better idea to use ifnames everywhere instead, but
that would change the format of the state file.

(cherry picked from commit bcb685c4cb)
2016-11-03 12:24:01 +01:00
Thomas Haller
b071c91eef core: add nm_device_get_permanent_hw_address_full() function
This is a partial cherry-pick from commit 5912b2f9a1.
2016-11-03 12:24:01 +01:00
Thomas Haller
977fbf7089 libnm-core/utils: update hwaddr utilities
_nm_utils_hwaddr_length() did a validation of the string
and returned the length of the address. In all cases where
we were interested in that, we also either want to validate
the address, get the address in binary form, or canonicalize
the address.

We can avoid these duplicate checks, by using _nm_utils_hwaddr_aton()
which both does the parsing and returning the length.

(cherry picked from commit e5fe5a4c03)
2016-11-03 12:24:00 +01:00
Thomas Haller
a67eb9d8d0 logging: remove LOGD_HW alias for LOGD_PLATFORM
Since commit 1495853e01, LOGD_HW is renamed to
LOGD_PLATFORM. Remove the internal usage of the deprecated name.

Backport this patch to nm-1-4 because it avoids follow-up conflicts with
future backports. Also, it is a really trivial change, meaning, we only
replace the obsolte LOGD_HW name.

(cherry picked from commit 64951f07fb)

Conflicts:
    src/devices/nm-device.c
    src/devices/wwan/nm-modem.c
2016-11-03 12:23:07 +01:00
Beniamino Galvani
dbacb9ae09 ppp: add counter to D-Bus object path for PPP manager instances
There can be multiple PPP connections active, each with its own PPP
manager.

Fixes: c1dd3b6eed
(cherry picked from commit bc26f94d1e)
2016-11-02 13:24:27 +01:00
Thomas Haller
b14fe3ce08 core: don't unmanage devices on shutdown
... except Wi-Fi and devices that cannot assume connections at all.

https://bugzilla.redhat.com/show_bug.cgi?id=1371126
https://bugzilla.redhat.com/show_bug.cgi?id=1378418
(cherry picked from commit d298b7c96d)
2016-10-27 11:12:22 +02:00
Beniamino Galvani
940cb6eb87 wwan: fix wrong connection cast on device state change
nm_settings_connection_set_autoconnect_blocked_reason() must be called
on the settings-connection. Fixes the following:

GLib-GObject-WARNING **: invalid cast from 'NMSimpleConnection' to 'NMSettingsConnection'

Fixes: 06da353242
(cherry picked from commit 7034ea7aa3)
2016-10-26 13:28:07 +02:00
Thomas Haller
cbfdb72db2 ifcfg-rh: fix signature of link_changed() callback
Depending on how arguments are passed to the called function,
this could lead to a crash.

Maybe not on 32 bit machines where the size of the pointer is
the size of an int.

Maybe not on x86_64, where the arguments are passed in registers.

Fixes: b88c309167
(cherry picked from commit 548a5440e9)
2016-10-22 17:14:24 +02:00
Beniamino Galvani
84d213f7c5 platform: avoid unaligned access to link stats on 64bit architectures
The undefined behavior sanitizer complains with:

platform/nm-linux-platform.c:1482:31: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1483:29: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1484:31: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1485:29: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^

That's because the pointer returned by nla_data() is only
32bit-aligned and using it to access structure members can cause
issues on some 64bit architectures.

Use the unaligned_read_ne64() macro to access the structure members.

https://bugzilla.gnome.org/show_bug.cgi?id=772605
(cherry picked from commit 89bcf50f61)
2016-10-14 11:23:51 +02:00
Beniamino Galvani
82b953d707 supplicant: fix cancellation of interface association
The @assoc_cancellable was never initialized and thus ineffective; fix
this.

Furthermore, we only cancel it in nm_supplicant_interface_disconnect()
as we expect that clients call the function before destroying the
interface. Don't assume this and also cancel it in dispose().

https://bugzilla.redhat.com/show_bug.cgi?id=1383628
(cherry picked from commit 0539725aef)
2016-10-14 10:07:58 +02:00
Beniamino Galvani
cfe74bc01a session-monitor: fix parsing of ConsoleKit database
The section name is "Session", not "CkSession".  Restore the correct
value, changed by commit 0de60b300e ("session: merge
nm-session-monitor-* modules").

Fixes: 0de60b300e

https://bugzilla.gnome.org/show_bug.cgi?id=772640
(cherry picked from commit db9589f0ce)
2016-10-13 09:48:45 +02:00
Beniamino Galvani
edf4bf2f35 session-monitor: use logging macros
Use logging macros and also, print the session tracking method during
startup for debugging purposes.

(cherry picked from commit 0e7f834a6f)
2016-10-13 09:48:10 +02:00
Dan Williams
58e01e9c98 wwan/ppp: send explicit port speed to pppd when port speed is zero (rh #1281731)
Some TTY drivers or devices appear to ignore port speed and always
report zero.  Technically this means the port is hung up and control
lines should be disconnected, but with USB devices many of the serial
port attributes are meaningless and ignored by some devices.

pppd requires the port's speed to be greater than zero, and will
exit immediately when that is not the case, even though these
modems will work fine.  Passing an explicit speed to pppd in this
case works around the issue, as pppd attempts to set that speed
on the port and doesn't actually care if that operation fails.

https://bugzilla.redhat.com/show_bug.cgi?id=1281731
(cherry picked from commit 01de14b1ddcd011ebc2f4676e5950b9ec890c698)
2016-10-07 14:54:50 -05:00
Thomas Haller
7ae2f0f6f4 core: remove unnecessary includes to netlink/route library
We no longer use libnl-route-3 library in NetworkManager. Remove the
unnecessary includes.

(cherry picked from commit 3ceaef90fe)
2016-10-07 21:37:56 +02:00
Lubomir Rintel
9fc48c31a0 device: consider a device with slaves configured
Do assume connections for it.

https://bugzilla.redhat.com/show_bug.cgi?id=1333983
(cherry picked from commit c3586ce01a)
2016-09-26 17:56:07 +02:00
Thomas Haller
f6c0c2d46e device: fix nm_utils_match_connection() for NMSettingInfiniband:mac-address
<debug> [1474469475.3318] Connection 'inf_ib0' differs from candidate 't-inf' in infiniband.mac-address
    <debug> [1474469475.3318] manager: (inf_ib0): generated connection 'inf_ib0'

https://bugzilla.redhat.com/show_bug.cgi?id=1375558
(cherry picked from commit 78957c0d39)
2016-09-22 16:49:15 +02:00
Beniamino Galvani
6c4a6f2b75 device: fix NULL pointer dereference in dhcp6_start()
Don't crash when nm_device_dhcp6_renew() calls dhcp6_start() with NULL
@reason.

Fixes: d1295b12e9
(cherry picked from commit dbf0b343ec)
2016-09-22 11:44:12 +02:00
Beniamino Galvani
b0463880fc manager: emit device-removed signal when a device unrealizes
The 'device-added' and 'device-removed' signals indicate when the
value of the 'Devices' property changes. The property only returns
realized devices and so if a device unrealizes we should emit the
removed signal for it.

Fixes: 5da37a129c

https://bugzilla.gnome.org/show_bug.cgi?id=771324
(cherry picked from commit cdedd2b53e)
2016-09-16 16:29:05 +02:00