Commit graph

16817 commits

Author SHA1 Message Date
Piotr Drąg
a710e127b4 po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277

[thaller@redhat.com: with `make -C po NetworkManager.pot update-po`]
2017-04-19 17:54:12 +02:00
Thomas Haller
764796af76 po: import Zanata translations 2017-04-19 17:51:07 +02:00
Thomas Haller
f7b2e9888b po: make update-po 2017-04-19 17:51:06 +02:00
Thomas Haller
6c6d94f23f gitignore: ignore .zanata-cache directory 2017-04-19 17:51:06 +02:00
Dan Williams
53626395fe auth-utils: fix possibly uninitialized variables
src/nm-auth-utils.c:343:6: error: 'is_authorized' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (is_authorized) {
      ^
src/nm-auth-utils.c:320:11: note: 'is_authorized' was declared here
  gboolean is_authorized, is_challenge;
           ^
src/nm-auth-utils.c:346:13: error: 'is_challenge' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   } else if (is_challenge) {
             ^
src/nm-auth-utils.c:320:26: note: 'is_challenge' was declared here
  gboolean is_authorized, is_challenge;
                          ^

(cherry picked from commit 24ab2a4945)
2017-04-07 11:53:16 -05:00
Dan Williams
39d42c1774 default-route-manager: fix possibly uninitialized variable
src/nm-default-route-manager.c: In function '_ipx_update_default_route':
src/nm-default-route-manager.c:769:23: error: 'is_assumed' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    if (!default_route && !is_assumed) {
                       ^
src/nm-default-route-manager.c:763:13: note: 'is_assumed' was declared here
    gboolean is_assumed;
             ^

(cherry picked from commit 857f26dd19)
2017-04-07 11:34:07 -05:00
Thomas Haller
e9f23553bd build: add slash to directory name for mkdir
Just for consistency with other locations that call
$(MKDIR_P).

(cherry picked from commit c2f0764c1e)
2017-04-07 11:22:24 -05:00
Lubomir Rintel
eca56d3cab build: create missing directories for out-of-tree builds
They could be created by dumb luck with dependency tracking, but
apparently some distributions disable that.

(cherry picked from commit 258382be12)
2017-04-07 11:22:18 -05:00
Beniamino Galvani
bb3b8627a0 device,default-route-manager: merge branch 'th/default-route-resync'
(cherry picked from commit 6197c27f24)
2017-04-03 13:24:57 +02:00
Thomas Haller
172f5bb2e9 default-route-manager: decryptify logging line for default-route-manager
The default route manager logs for each entry relevant information,
in a compact but cryptic way:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:1:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

The flag whether a route is configured or not, was only expressed
via 0|1. Change that to log instead:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:+has:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

(cherry picked from commit 82bfb6c46d)
2017-04-03 13:23:49 +02:00
Thomas Haller
6c7ef310b1 default-route-manager: alyways force a sync of the default route
Whenever we call update for a non-assumed, synced route, we must
force a resync with the platform. Even if according to our internal
book-keeping the route is already configured, the route may have
been removed externally. So we cannot assume that everything is
still up-to-date.

https://bugzilla.redhat.com/show_bug.cgi?id=1431268
(cherry picked from commit c3c251ea12)
2017-04-03 13:23:47 +02:00
Thomas Haller
ac515194a5 default-route-manager: use nm_cmp_uint32_p_with_data() instead of reimplementation
(cherry picked from commit 0057dc332e)
2017-04-03 13:23:45 +02:00
Thomas Haller
5e12056c9e default-route-manager: add nm_default_route_manager_resync() function
(cherry picked from commit e181956fdd)
2017-04-03 13:23:43 +02:00
Thomas Haller
27c7b786d9 default-route-manager: simplify _platform_changed_cb() handling
There is only one caller of _platform_ipx_route_changed_cb(). Inline it,
it is simpler.

(cherry picked from commit 70ab174e0e)
2017-04-03 13:23:39 +02:00
Thomas Haller
9a322b4e19 default-route-manager: simplify determining synced flag in _ipx_update_default_route()
No change in behavior at all. The same logic applies, but this should
be simpler to understand.

(cherry picked from commit 0b3ba99409)
2017-04-03 13:23:37 +02:00
Lubomir Rintel
58c9a41959 settings-connection: fix Save()
Avoid using new_settings when they are none. Also, don't shortcut when
the connection hasn't been changed -- let the settings plugin decide if
it needs to rewrite the connection.

(cherry picked from commit b47340fd3f)
2017-03-24 10:28:19 +01:00
Iain Lane
1715ec53c1 nm-manager: Use g_dbus_message_new_method_error_literal()
GLib 2.52 added a G_GNUC_PRINTF attribute to
g_dbus_message_new_method_error(). This triggered warning in
NetworkManager when built with -Wformat, which is an error when built
with -Werror=format-security. It seems that gcc isn't smart enough to
see that (foo = "bar") should be treated as a literal.

Fortunately there is a g_dbus_message_new_method_error_literal()
function which does not take printf-style arguments, and we don't need
them, so we can use that.

This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and
was submitted to Launchpad at

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
https://bugzilla.gnome.org/show_bug.cgi?id=780444
(cherry picked from commit 6a77258f4e)
2017-03-23 13:13:16 +01:00
Thomas Haller
441dbabfdd zanata: update project-version 2017-03-22 18:12:01 +01:00
Dan Williams
aef9e5f8b6 ppp: only request IPV6CP when IPv6 is enabled in the connection
NM always asks pppd to run IPV6CP which will complete if the modem supports
IPv6.  If the user doesn't want IPv6 then NM just ignores the result.  But
if the host has disabled IPv6, then pppd will fail to complete the connection
because pppd tries to assign the Link-Local address to the pppX interface,
and if IPv6 is disabled that fails and terminates the PPP session.

So only request IPV6CP when the user wants IPv6 on the connection; if they
have disabled IPv6 on their host then they can simply set ipv6.method=ignore.

https://mail.gnome.org/archives/networkmanager-list/2017-March/msg00047.html
(cherry picked from commit 8d4570d28d)
2017-03-22 08:36:16 -05:00
Beniamino Galvani
427a3e5cff manager: ensure proper disposal of unrealized devices
When remove_device() is called on an already unrealized device, we
should release it from master if necessary and clear its IP
configurations to avoid leaks.

https://bugzilla.redhat.com/show_bug.cgi?id=1433303
(cherry picked from commit 2e0c3d1dac)
2017-03-21 13:30:15 +01:00
Thomas Haller
6311bf6666 libnm: fix memleak of GUdevDevice in get_bus_name()
Fixes: f7b1b28202
(cherry picked from commit c033330c41)
2017-03-20 11:34:49 +01:00
Beniamino Galvani
238fc87298 device: fail DHCPv6 if a link-local address is not present
Instead of throwing an assertion, fail DHCPv6 when a IPv6 link-local
address is not configured on the device. There are different reasons
why the assertion may fail: for example the address was removed
externally; or the device is gone (and thus the platform already
received the notification of addresses removal) but the device is still
connecting because its disposal happens in an idle callback.

None of these deserves an assertion, which should only be for
programming errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1432251
(cherry picked from commit 4987ec408a)
2017-03-15 16:35:47 +01:00
Thomas Haller
a006361fca libnm: add assertion to NMObject that a dbus-object is set
The libnm cache types don't have public _new() functions.
However, such types can be easily created using g_object_new()
directly from user code.

Such a usage is not supported. Add an assertion that a valid
dbus-object is present.

(cherry picked from commit 556b7c3b45)
2017-03-09 15:22:17 +01:00
Thomas Haller
8a857c4475 libnm: chain up NMRemoteConnection::constructed() function
Fixes: 0fdd71fe6e
(cherry picked from commit 9ed0e3705e)
2017-03-09 15:22:16 +01:00
Thomas Haller
5cd90717ad platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142
(cherry picked from commit f0e295d3d7)
2017-03-09 15:21:46 +01:00
Beniamino Galvani
7a05d2a228 dhcp/dhclient: parse "interface" statements
Until now any "interface" statement was ignored and any enclosed
statement for which we have a special handling was considered, even if
belonging to a different interface. This can cause wrong options to be
set in the generated dhclient configuration.

Change the code to parse "interface" statements and skip the content
if the interface doesn't match.

https://bugzilla.gnome.org/show_bug.cgi?id=778430
(cherry picked from commit d405cfd908)
2017-03-03 14:18:20 +01:00
Beniamino Galvani
f950df775f dns/resolved: consider configuration from unmanaged devices
The DNS configuration for VPN connections is associated to the VPN
device (tun, ppp, etc.) and that device can be unmanaged by NM: don't
ignore such configuration. We do the same for other DNS plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=779087
(cherry picked from commit 913896721d)
2017-02-24 21:13:16 +01:00
Lubomir Rintel
662b1f8b7c tui: generate names for bonds, teams and bridges
This makes it more likely that the user will end up with a master
connection that has connection.interface-name property. This makes it
possible for ifcfg plugin to specify the master in the for of device
name (as opposed to UUID) for compatibility with the legacy network
tooling.

This is equivalent to what nmcli does.

https://bugzilla.redhat.com/show_bug.cgi?id=1369091
(cherry picked from commit ff46158d9e)
2017-02-20 16:08:59 +01:00
Thomas Haller
a72ded7902 device/wifi: fix #if check for more-logging
Fixes: ae158bf178
(cherry picked from commit 35d4e8f7a0)
2017-02-19 19:16:37 +01:00
Beniamino Galvani
0429753dab libnm: disconnect signal from D-Bus proxies on dispose
https://bugzilla.gnome.org/show_bug.cgi?id=778615
(cherry picked from commit 5ae3db7515)
2017-02-18 10:29:05 +01:00
Thomas Haller
e107d0917b device/wifi: silence some logging for AP changes
We log updates of the Wi-Fi AP with a separate logging domain LOGD_WIFI_SCAN.
However, there is ony "update" message that is triggered every 6 seconds, which
becomes especially verbose.

Suppress this one and only log it when compiled --with-more-logging. And then
only log with level LOGL_TRACE, so the user still can filter this one out.

(cherry picked from commit ae158bf178)
2017-02-17 20:34:21 +01:00
Thomas Haller
803e1a04bb contrit/rpm: create source tarball from git immidiately in SOURCES directory
Instead of first creating it as "$TEMP/NetworkManager-${VERSION}.tar.xz"
and then copy it to "$TEMP/SOURCES".

(cherry picked from commit 5caa9d877b)
2017-02-17 19:45:02 +01:00
Thomas Haller
505e474631 contrit/rpm: print the used "$SOURCE" tarball in the summary output of build.sh
(cherry picked from commit b04868cb52)
2017-02-17 19:45:02 +01:00
Thomas Haller
1dbb6b3150 device/wifi: merge branch 'th/device-wifi-wait-for-scan-bgo770938'
https://bugzilla.gnome.org/show_bug.cgi?id=770938
https://bugzilla.gnome.org/show_bug.cgi?id=777831

(cherry picked from commit fe6204ffc7)
2017-02-17 19:43:59 +01:00
Thomas Haller
f270bc34b4 device/wifi: block autoconnect while scanning is in progress
We should only start autoconnecting after the scan is complete.
Otherwise, we might activate a shared connection or pick a
connection based on an incomplete scan list.

https://bugzilla.gnome.org/show_bug.cgi?id=770938
(cherry picked from commit 2ab2254dd7)
2017-02-17 19:39:31 +01:00
Thomas Haller
4bf493fcaf device: add get_autoconnect_allowed() virtual function
It allows derived classes to override the autoconnect-allowed
state.

We already have

- NM_DEVICE_AUTOCONNECT property, which is two parts:
  - NMDevicePrivate::autoconnect_user, which is settable via
    D-Bus by the use, to allow the device to autoconnect.
  - NMDevicePrivate::autoconnect_intern, which is set by
    internal decision.
- NM_DEVICE_AUTOCONNECT_ALLOWED signal, where other devices can
  subscribe to block autoconnect. Currently that is only used
  by NMDeviceOlpcMesh.

These two make up for nm_device_autoconnect_allowed().

Add another way to allow derived classes to disable autoconnect
temporarily. This could also be achieved by having the device
subscribe to NM_DEVICE_AUTOCONNECT_ALLOWED of self, or by adding
a signal slot. But a plain function pointer seems easier.

(cherry picked from commit 6eaded9071)
2017-02-17 19:39:28 +01:00
Thomas Haller
da37c8ac6c device: separately handle NMDevice's autoconnect by user and internal decision
The NMDevice's autoconnect property is settable via D-Bus and is is
also modified by internal decision, like when no PIN is available.

Certain internal actions cause clearing the internal autoconnect flag,
but they should not override the user desicion.

For example, when NM awaks from sleep it would reenable autoconnect,
but it should not reenable it for devices where the user explicitly
said that autoconnect is to be disabled.

Similarly, activating a device alone is not yet an instruction to
re-enable autoconnect. If the user consciously disables autoconnect,
it should stay enabled. On the other hand, activating a device should
reenable autoconnect if it was blocked by internal decision.

We need to track these two flags separately, and set them accordingly.

(cherry picked from commit 2f9166e6b9)
2017-02-17 19:39:25 +01:00
Thomas Haller
b8af01b455 wifi: also show the NM D-Bus path for the Wi-Fi AP in nm_wifi_ap_to_string()
(cherry picked from commit 257484e7ba)
2017-02-17 19:39:21 +01:00
Thomas Haller
7f7bed4736 wifi: only react on AP update signal when there are actual changes
Since we emit BSS_UPDATED signal before SCAN_DONE, it is very likely
that nothing actually changed. This clutters the logs with update
messages.

Also move the added/removed logging messages inside ap_add_remove().
We would call ap_add_remove() at several places without logging the
change.

(cherry picked from commit c9dc0eba65)
2017-02-17 19:39:17 +01:00
Thomas Haller
b4fe07e96e supplicant: delay SCAN_DONE signal until all BSS are initialized
We initialize the BSS asyncronously. Don't declare SCAN_DONE
until all BSS are up.

Otherwise, especially during the very first scan we declare SCAN_DONE
when having no BSS yet. This wrongly removes the pending action
"wifi-scan", while "autoconnect" cannot happen as there are not BSS
yet. Thus we declare "startup-complete" too early.

Another issue is that we may start autoconnecting with an incomplete
scan list, and thus pick a non-preferred connections.

https://bugzilla.gnome.org/show_bug.cgi?id=777831
(cherry picked from commit e0f9677018)
2017-02-17 19:39:00 +01:00
Thomas Haller
13b17d44dc wifi: check for invalid BSSID in nm_wifi_ap_update_from_properties()
In nm_wifi_ap_new_from_properties(), we checked that the BSSID is valid
and bailed out otherwise. Since we call nm_wifi_ap_update_from_properties()
on a created BSSID, we should ensure there too that an update does not cause
the address to become invalid.

In the unlikely case where an update would change a previously valid address
to an invalid one, we would ignore the update.

Thus, move the check for addresses inside nm_wifi_ap_update_from_properties().

(cherry picked from commit e3a489180b)
2017-02-17 19:38:03 +01:00
Thomas Haller
c961c36c8f supplicant: merge NEW_BSS signal with BSS_UPDATED
Before, the NEW_BSS signal was not careful to emit the signal only when the BSS
is seen for the first time. Consequently, supplicant_iface_new_bss_cb() checked
whether it already knows about the new BSS.

Merge NEW_BSS and BSS_UPDATED. Now we emit BSS_UPDATED when either the
BSS is new or changed.

Also, in supplicant_iface_new_bss_cb() (now supplicant_iface_bss_updated_cb())
no longer constructs an @ap instance if we have a @found_ap.

In some situations there can be a value of having a separate ADD signal.
But only when there the consumers care, and if the consumers can trust that
ADD is not just an UPDATE. The only consumer doesn't care and it not not be
trusted, so merge the signals.

(cherry picked from commit 29a53b1cd7)
2017-02-17 19:38:00 +01:00
Thomas Haller
fbe98ba107 supplicant: cleanup network when cancelling "AddNetwork" request
If the assoc-request is cancelled while an "AddNetwork" request is
pending, we must cleanup the added network when the request succeeds.

The issue can also happen when NetworkManager shuts down and exits
the mainloop. This scenario is unsolved as the cleanup action
"RemoveNetwork" has no chance to run.

"AddBlob" works differently in that blogs are added with a specific name,
not like "AddNetwork", where a new D-Bus path is created. Maybe we should
also cleanup blobs that were added by us, but currently we don't.

(cherry picked from commit c47026715e)
2017-02-17 19:37:57 +01:00
Thomas Haller
a6d3d17f5e supplicant: remove unused return value from nm_supplicant_interface_request_scan()
It cannot fail, remove code that anticipates a failure of request-scan.

(cherry picked from commit dce13b6f11)
2017-02-17 19:37:55 +01:00
Thomas Haller
6ce8cf361a supplicant: use nm_clear_g_cancellable() helper
(cherry picked from commit da34034b95)
2017-02-17 19:37:52 +01:00
Thomas Haller
990810ed7c supplicant/trivial: move code around
(cherry picked from commit e16bf4f3db)
2017-02-17 19:37:17 +01:00
Thomas Haller
2735e614b7 supplicant: rework nm_supplicant_interface_set_config() to invoke result callback
Instead of having a NM_SUPPLICANT_INTERFACE_CONNECTION_ERROR signal to notify
about failures during AddNetwork/SelectNetwork, accept a callback to report
success/failure.

Thereby, rename nm_supplicant_interface_set_config() to
nm_supplicant_interface_assoc().

The async callback is guaranteed to:

 - be invoked exactly once, signalling success or failure
 - always being invoked asyncronously.

The pending request can be (synchronously) cancelled via
nm_supplicant_interface_disconnect() or by disposing the
interface instance. In those cases the callback will be invoked
too, with error code cancelled/disposing.

(cherry picked from commit 66c45d0fdc)
2017-02-17 19:37:15 +01:00
Thomas Haller
051fd25fc6 wifi: introduce enum type NMSupplicantInterfaceState instead of plain int
Also change the signature of the NM_SUPPLICANT_INTERFACE_STATE signal,
to have three "int" type arguments. Thereby also fix the subscribers
to this signal that wrongly had type guint32, instead of guint
(which happens to be the same underlying type, so no real problem).

https://mail.gnome.org/archives/networkmanager-list/2017-February/msg00021.html
(cherry picked from commit 5a03de7051)
2017-02-17 19:37:06 +01:00
Thomas Haller
408e988a55 contrib/rpm: add explict configure options for building NetworkManager in "build_clean.sh"
When we create a source tarball, documentation and other generated files
are disted. Those files depend on the configure options when creating
the tarball. For example, the generated man pages contain the compile time
configurable default values.

For that reason, it is generally better to regenerate the documentation when
building NetworkManager. However, let's set explict configure options to
have a more reproducible way to generate the tarball.

When doing a release, you should not just call `make dist`. Instead, the
proper way of creating an official source tarball is:

  $ ./contrib/fedora/rpm/build_clean.sh --srpm

(cherry picked from commit 432717cf47)
2017-02-15 23:29:57 +01:00
Thomas Haller
9dde8263da build: fix dist-ing "man/common.ent.in"
(cherry picked from commit 4179cbb677)
2017-02-15 23:29:56 +01:00