Commit Graph

13265 Commits

Author SHA1 Message Date
Jiří Klimeš
984714333f supplicant: fix BSSs property type
BSSs property is an array of object paths, not strings.
2015-10-02 09:36:09 +02:00
Lubomir Rintel
b1512221bc nm-vpn-service-plugin: increase the quit timer
We now (since 3272ff6 libnm/libnm-glib: don't quit in the middle of asking for
secrets) always hook on the quit timer when NM asks the plugin if it needs
secrets. The timer is 20 seconds, which seems too short.

Let's make it three minutes. Don't bother adding another timer or using a
distinct timeout: it does no harm for the plugin to remain unused for three
minutes on a bus.

Another option would be to completely unhook it; however the plugin wouldn't
learn if the user cancelled the NM's secrets request and would remain unused
on the bus forever.
2015-10-01 17:17:52 +02:00
Lubomir Rintel
d4a7645865 nm-config: drop a glib 2.40-ism
Fixes: ae9e82354a
2015-10-01 10:10:58 +02:00
Beniamino Galvani
f04b27bd1f core: merge branch 'bg/global-dns-conf-bgo750458'
Add support for a global DNS configuration read from user
configuration file or set through D-Bus.

https://bugzilla.gnome.org/show_bug.cgi?id=750458
2015-10-01 09:21:32 +02:00
Beniamino Galvani
c83ac1ed41 manager: export DNS global configuration D-Bus property 2015-10-01 09:05:08 +02:00
Beniamino Galvani
dd6fbe7bfa man: document global DNS configuration sections 2015-10-01 09:05:08 +02:00
Beniamino Galvani
ae9e82354a dns: add support for global configuration in DNS manager
Modify the DNS manager to use the static global DNS configuration when
available. In addition, change DNS plugins interface to accept a new
argument for global configuration and add support for this new
parameter to the dnsmasq plugin.
2015-10-01 09:05:08 +02:00
Beniamino Galvani
55c204b9a3 core: add support for reading global DNS configuration from keyfile
Add to the NMConfigData object information about global DNS
configuration, which is loaded from user or internal keyfile upon
object construction.
2015-10-01 09:05:08 +02:00
Beniamino Galvani
bd27c110a3 glib-compat: add g_hash_table_get_keys_as_array() compat function 2015-10-01 09:05:08 +02:00
Thomas Haller
804ec6fbcd contrib/rpm: remove dbus-glib dependancy
Only libnm-glib still requires dbus-glib.
2015-09-30 23:10:56 +02:00
Thomas Haller
7bf10a75db build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h"
For libnm library, "nm-dbus-interface.h" contains defines like the D-Bus
paths of NetworkManager. It is desirable to have this header usable without
having a dependency on "glib.h", for example for a QT application. For that,
commit c0852964a8 removed that dependancy.

For libnm-glib library, the analog to "nm-dbus-interface.h" is
"NetworkManager.h", and the same applies there. Commit
159e827a72 removed that include.
However, that broke build on PackageKit [1] which expected to get the
version macros by including "NetworkManager.h". So at least for libnm-glib,
we need to preserve old behavior so that a user including
"NetworkManager.h" gets the version macros, but not "glib.h".

Extract the version macros to a new header file "nm-version-macros.h".
This header doesn't include "glib.h" and can be included from
"NetworkManager.h". This gives as previous behavior and a glib-free
include.

For libnm we still don't include "nm-version-macros.h" to "nm-dbus-interface.h".
Very few users will actually need the version macros, but not using
libnm.
Users that use libnm, should just include (libnm's) "NetworkManager.h" to
get all headers.
As a special case, a user who doesn't want to use glib/libnm, but still
needs both "nm-dbus-interface.h" and "nm-version-macros.h", can include
them both separately.

[1] https://github.com/hughsie/PackageKit/issues/85

Fixes: 4545a7fe96
2015-09-30 23:10:29 +02:00
Thomas Haller
b861900d45 tui: fix crash during activation when failed to create secret-agent
NetworkManager only allows one 'client:user-id' to register as secret
agent. Thus, when starting nmtui in two terminals, creating the secret
agent can fail.

This can lead to a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=755883
2015-09-30 17:33:01 +02:00
Lubomir Rintel
4fe86b0031 dnsmasq-manager: forget the watch when the callback hits
It removes the source, we shouldn't try to remove it on dispose() then.
2015-09-30 16:35:33 +02:00
Lubomir Rintel
bde246d30b bus-manager: only unregister skeletons if they were actually registered 2015-09-30 16:35:32 +02:00
Lubomir Rintel
30a0c3164c firewall-manager: handle bus connection failure 2015-09-30 16:02:48 +02:00
Thomas Haller
a9b1869d63 all: use glib compatibility functions for g_hash_table_add() and g_hash_table_insert() 2015-09-30 14:12:25 +02:00
Thomas Haller
261dff429e glib-compat: add compatibility function for g_hash_table_insert() and g_hash_table_add()
They have a different name, because we don't want to do the
extra work unless explicitly requested.
2015-09-30 14:11:47 +02:00
Lubomir Rintel
df27e6d5fd build: add .travis.yml 2015-09-30 13:43:03 +02:00
Lubomir Rintel
36e5c0a821 all: g_hash_table_add doesn't return a value before 2.40 2015-09-30 13:43:03 +02:00
Lubomir Rintel
3227778d89 manager: fix a reversed conditional
find_ac_for_connection() needs the uuid when the connection is not a
NMSettingConnection.

Fixes: 06da353242
2015-09-30 12:14:02 +02:00
Lubomir Rintel
e0fa48f224 vpn-connection: set the MTU for the VPN IP interface
The 9b79e6c73 commit moved setting of the MTU from IP4Config to NMDevice, but
VPN connections don't have a NMDevice instance (yet). Set the MTU also from the
VPN connection. Also, copying of the MTU to the IP4Config is no longer needed
as the ip4_config_commit no longer sets the MTU.

Fixes: 9b79e6c732ffb2fb105647c1465070d36a6cc180

https://bugzilla.gnome.org/show_bug.cgi?id=754781
2015-09-29 18:24:48 +02:00
Lubomir Rintel
8b0bb7a022 firewall-manager: avoid leaving dangling request if firewalld is not running
Unhook it prior to deallocation. Fixes an assertion on daemon shutdown:

  NetworkManager[30037]: <info>  exiting (success)
  **
  NetworkManager:ERROR:nm-firewall-manager.c:489:dispose: assertion failed: (g_hash_table_size (priv->pending_calls) == 0)
  Aborted (core dumped)

Fixes: 94f888a262
2015-09-29 14:10:47 +02:00
Lubomir Rintel
b38bc15747 build: set -Werror when checking whether a -W<warning> option works
Otherwise the check is effectively a no-op and unknown options still get
turned on. This results in unknown warnings when build without
--with-extra-warnings=error:

  warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
2015-09-29 14:08:14 +02:00
Jiří Klimeš
edec77fba4 merge: S390 subchannels improvements (bgo #755610)
- export device's S390 subchannels on D-Bus
- update 390 subchannels comparison for connection vs.device compatibility
- support s390 subchannels in libnm and nmcli

https://bugzilla.gnome.org/show_bug.cgi?id=755610
2015-09-29 09:41:45 +02:00
Jiří Klimeš
82e4364480 tests: add a test for connection_compatible() for wired devices
Allow setting MAC address and S390 subchannels for ethernet devices in
testing NM service.
2015-09-29 09:31:41 +02:00
Jiří Klimeš
e7ed259fdc cli: print s390 subchannels for devices that have that 2015-09-29 09:31:41 +02:00
Jiří Klimeš
9abe74d98e libnm: match s390 subchannels and MAC blacklist in connection_compatible()
Basically, make it the same as check_connection_compatible()
in src/devices/nm-device-ethernet.c
2015-09-29 09:31:25 +02:00
Jiří Klimeš
bbaca1b24e libnm: add 390-subchannels property to NMDeviceEthernet 2015-09-29 09:31:25 +02:00
Jiří Klimeš
4219aa9a56 device: export S390Subchannels property on Ethernet device
and update match_subchans() to compare number of subchannels too.
2015-09-29 09:30:01 +02:00
Lubomir Rintel
8e6a839d93 contrib/rpm: regenerate automake with locally present version
The modification of po/Makefile.in.in may trigger re-run of autotools and it
would fail if the versions differ.

Fixes: 2318c0de92
2015-09-28 19:50:09 +02:00
Thomas Haller
4545a7fe96 Revert "libnm-util: don't include "nm-version.h" in "NetworkManager.h""
This breaks build of PackageKit. Revert the patch.

This reverts commit 159e827a72.

https://bugzilla.gnome.org/show_bug.cgi?id=755660
2015-09-26 13:15:58 +02:00
Beniamino Galvani
7cf5c326bc device: ensure firewall zone is set on the actual IP interface
For certain types of connection as PPP and WWAN the IP interface is
created during stage3 (IP config) but we are setting the firewall zone
at the beginning of stage3 and thus the zone is only set on the
underlying interface.

Add a check at the start of IP check phase to ensure that the firewall
zone is set again if the device interface is different from IP
interface.

https://bugzilla.redhat.com/show_bug.cgi?id=1110465
2015-09-26 09:47:21 +02:00
Dan Williams
5b374a4a9f device: increase IPv6LL DAD timeout (rh #1101809)
Depending on the network and the values of the 'dad_transmits' and
'retrans_timeout_ms' sysctls, DAD for the IPv6LL address can take
quite a while.  Obviously there must be some upper bound on the
timeout, but 5 seconds seems a bit low.  In this case it was observed
to be ~12 seconds but the sysctl values are unknown.  In any case,
we can't predict the network/config so being a bit more lenient here
makes sense.

https://bugzilla.redhat.com/show_bug.cgi?id=1101809
2015-09-25 11:27:46 -05:00
Thomas Haller
c60ff9e7e0 libnm: add NM_AVAILABLE_IN_1_2 to "nm-dbus-interface.h"
"nm-dbus-interface.h" can be used without glib/libnm, hence we must
workaround a missing NM_AVAILABLE_IN_1_2 macro.
2015-09-25 16:22:47 +02:00
Jiří Klimeš
12e6cf1f20 libnm-core/libnm-util: fix an erroneous error message
ipv6.dns: 'this property is not allowed for '%s=%s'' not allowed for method=ignore
2015-09-25 16:11:24 +02:00
Jiří Klimeš
ecf0849355 cli: allow 'ipv6' and 'ppp' settings for GSM and CDMA connections (rh #1265993)
Otherwise the settings cannot be changed.

https://bugzilla.redhat.com/show_bug.cgi?id=1265993
2015-09-25 15:50:22 +02:00
Jiří Klimeš
0c1124b903 cli: fix error string format
clients/cli/.libs/nmcli con mod profile con.zone
Error: Error: value for 'con.zone' is missing..

Fixes: 15149d915f
2015-09-25 15:50:22 +02:00
Thomas Haller
0e223d4961 libnm: include "glib.h" in "nm-version.h"
This is a forward port of commit 6f616d4c4b04d5478f60d0311317bc84c5459ea4
which added this patch on nm-1-0 branch.

However, the reason stated there is wrong because we don't need this
to fix Qt examples. Building Qt examples was fixed in that "nm-dbus-interface.h"
no longer drags in "nm-version.h".

On the other hand, we still want "nm-version.h" to be self-contained,
and include "glib.h" as it needs it.
2015-09-25 15:48:09 +02:00
Thomas Haller
159e827a72 libnm-util: don't include "nm-version.h" in "NetworkManager.h"
We want "NetworkManager.h" to have no dependancy on libnm and glib.
2015-09-25 15:42:15 +02:00
Thomas Haller
c0852964a8 libnm: don't include "nm-version.h" in "nm-dbus-interface.h"
We want "nm-dbus-interface.h" to have no dependancy on libnm and glib.
That way, it is usable for example in the QT examples without dragging
in dependencies to glib.

Also drop all the unneccessary include to "nm-dbus-interface.h", which
we already get by directly or indirectly including "nm-core-types.h".
2015-09-25 15:42:15 +02:00
Jiří Klimeš
66b7e45708 man: fix in nm-settings-ifcfg-rh description 2015-09-25 13:23:44 +02:00
Jiří Klimeš
9294962cc4 cli: remove static width parameter from fields definition
The width is no longer needed because the actual field's width is computed
dynamically just before printing.
(as of commit e6870789b5)
2015-09-25 12:09:51 +02:00
Thomas Haller
19dd0574a7 firewall: merge branch 'th/firewall-callback-bgo755539'
https://bugzilla.gnome.org/show_bug.cgi?id=755539
2015-09-25 10:34:03 +02:00
Thomas Haller
bb7e6c2cd4 firewall: always take a reference to NMFirewallManager during asynchronous operations
Always take a reference to the manager when scheaduling an asynchronous
operations. In fact, all callers want to keep the manager alive as long
as there are operations in progress.
2015-09-25 10:34:03 +02:00
Thomas Haller
94f888a262 firewall: refactor callback handling in NMFirewallManager
Refactor NMFirewallManager to have consistent semantics about
asynchronous calls.

  - the callback is always invoked exactly once, but never
    synchronously when starting the operation.
  - while cancelling the request, the callback is invoked
    synchronously with respect to the cancel operation.
  - you can cancel a request once (and once only).
  - you cannot cancel the request once the callback is invoked.
  - when disposing the object with requests pending, the
    callbacks are invoked synchronously.

- Add a callback argument to nm_firewall_manager_remove_from_zone().
  Otherwise, the user never knows whether a call is still pending and
  cancellable (as complete operations cannot be cancelled).
  In fact, it makes no sense trying to cancel a call if you don't care
  about when it completes.

- get rid of PENDING_CALL_DUMMY. The dummy callback allows cancellation
  any number of times. We want to catch wrong usage by asserting that an
  operation is only cancelled once.

- nm_firewall_manager_cancel_call() doesn't need the manager argument.
  Either the call-id is valid (and has a valid pointer to the manager),
  or there is a bug and it is a dangling pointer.
2015-09-25 10:34:02 +02:00
Thomas Haller
5bc4d7f0f9 firewall: add arguments to NMFirewallManagerAddRemoveCallback
We should return the target object and the call_id.
2015-09-25 10:34:02 +02:00
Thomas Haller
d3a8254681 firewall/trivial: rename FwAddToZoneFunc to NMFirewallManagerAddRemoveCallback
Give it a proper NMFirewallManager* prefix to make it clear where the type belongs.
Also, we will add a similar callback for nm_firewall_manager_remove_from_zone(),
so reflect that in the name.
2015-09-25 10:34:02 +02:00
Thomas Haller
0d33b73e42 firewall/trivial: rename NMFirewallPendingCall to NMFirewallManagerCallId
Matches the naming scheme for other call-ids.
2015-09-25 10:34:02 +02:00
Thomas Haller
320f454e9f core: use NM_UTILS_ERROR_CANCELLED_DISPOSING error reason 2015-09-25 10:34:02 +02:00
Thomas Haller
44f3f18797 core: add NM_UTILS_ERROR 2015-09-25 10:34:02 +02:00