summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cli: get NMClient early and remove duplicated codejk/nmcli-NM-running-fixesJiří Klimeš2014-09-192-132/+13
|
* cli: when NM is not running, give this error in 'nmcli connection'Jiří Klimeš2014-09-191-3/+10
| | | | | Check whether NM is running before comparing nmcli and NM versions. Returning NMC_RESULT_ERROR_NM_NOT_RUNNING is in accordance with other nmcli commands.
* cli: return a failure status when the daemon is not running (bgo #698060)Lubomir Rintel2014-09-191-28/+23
| | | | | | | | | | | | Applies to status commands such as "nmcli radio" or "nmcli g status". This is consistent with other commands. The "RUNNING" field is now always "running", the tool will just return an error instead of setting it to "not running". It never signalled whether the daemon was actually running anyway, only whether the client managed to connect to it. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* libnm-core: don't return with a value in function returning voidJiří Klimeš2014-09-191-1/+1
| | | | set_property_from_dbus()
* Port libnm and clients to gdbus (bgo #622927)Dan Winship2014-09-18121-5014/+3654
|\
| * libnm: port to GDBusDan Winship2014-09-1860-2334/+1759
| | | | | | | | | | | | | | | | | | Port libnm-core/libnm to GDBus. The NetworkManager daemon continues to use dbus-glib; the previously-added connection hash/variant conversion methods are now moved to NetworkManagerUtils (along with a few other utilities that are now only needed by the daemon code).
| * libnm-core: update tests to be fully variant-basedDan Winship2014-09-183-38/+23
| | | | | | | | | | Use nmtst_variant_editor() to rewrite the libnm-core tests to work entirely in connection dictionaries, not connection hash tables.
| * nmtst: add NMTST_VARIANT_EDITOR()Dan Winship2014-09-181-0/+88
| | | | | | | | | | | | | | Several test programs create connection hashes and then modify them in various ways. This becomes much more complicated with GVariants, since they are immutable. Add NMTST_VARIANT_EDITOR() to simplify the process of iterating the old variant and building a new, slightly-modified one.
| * libnm-core: change connection hash tables to variants in APIDan Winship2014-09-1857-2205/+1333
| | | | | | | | | | | | | | | | | | | | In preparation for porting to GDBus, make nm_connection_to_dbus(), etc, represent connections as GVariants of type 'a{sa{sv}}' rather than as GHashTables-of-GHashTables-of-GValues. This means we're constantly converting back and forth internally, but this is just a stepping stone on the way to the full GDBus port, and all of that code will go away again later.
| * libnm: rename nm-dbus-helpers-private.h to nm-dbus-helpers.hDan Winship2014-09-189-8/+8
| | | | | | | | The .h file should have the same name as the .c file.
| * libnm: split nm-dbus-helpers utils into sync/async versionsDan Winship2014-09-184-139/+367
| | | | | | | | | | | | | | | | | | | | dbus-glib's functions to get a DBusGConnection or a DBusGProxy return right away, but gdbus's corresponding functions do some initial setup and communication as part of initialization, and so either block or run async. So split _nm_dbus_new_connection() and _nm_dbus_new_proxy_for_connection() into sync and async versions now, and update NMObject to use the correct one depending on whether it is working synchronously or asynchronously.
| * libnm: move most of the subclass-type-deciding code into NMObjectDan Winship2014-09-184-220/+116
| | | | | | | | | | | | | | | | | | | | NMObject has a system that lets devices and active connections get created as the correct subtypes (NMDeviceFoo / NMActiveConnection vs NMVpnConnection). But it was much more generic than it needed to be, because NMDevice and NMActiveConnection both did the same thing (fetch a D-Bus property and then look at its value). So move the property-fetching part into NMObject, and only use the callback for converting the property value to a GType.
| * libnm: let NMObject create all D-Bus proxiesDan Winship2014-09-1827-262/+177
| | | | | | | | | | | | | | | | | | | | | | | | Add _nm_object_class_add_interface(), for declaring that a class implements a particular interface, and then have NMObject create the corresponding proxies itself. (The subclass can get a copy with _nm_object_get_proxy() if it needs it for something). (In GDBus, creating a proxy is a heavier operation than in dbus-glib, so we'll need to create the proxies asynchronously. Moving the creation to NMObject makes that easier since we can do it as part of the existing init/init_async.)
| * libnm: don't hardcode things like "org.freedesktop.DBus.Properties"Dan Winship2014-09-184-8/+8
| | | | | | | | Use the #defines provided by libdbus instead.
| * libnm: merge libnm-vpn into libnmDan Winship2014-09-1810-87/+59
| | | | | | | | | | | | | | | | | | | | | | There's not much point in keeping them separate: all existing libnm-glib-vpn users also link against libnm-glib, and the amount of extra code added to libnm by merging in libnm-vpn is negligible. Additionally, nm-vpn-plugin will later need access to some libnm-internal APIs. So, merge them together.
| * tools: fix test-networkmanager-service Settings.ConnectionsDan Winship2014-09-181-2/+5
|/ | | | The test settings service wasn't exporting a Connections property.
* Port callouts to gdbus (bgo #622927)Dan Winship2014-09-1813-622/+1053
|\
| * dispatcher: make test-dispatcher-envp not take an argumentDan Winship2014-09-182-21/+19
| | | | | | | | | | | | Compile srcdir into test-dispatcher-envp rather than passing it on the command-line, to make it easier to run by hand, and so we can use automake's TESTS support.
| * dispatcher: port to GDBusDan Winship2014-09-188-475/+390
| | | | | | | | | | Port nm-dispatcher to GDBus, mostly, using dbus-glib's GVariant utilities to translate the return value of nm_connection_to_dbus().
| * dispatcher: trivial code rearrangementDan Winship2014-09-181-102/+106
| | | | | | | | | | | | | | | | | | | | Reorganize some code in preparation for the GDBus port. (Most of the diff is actually just reindentation.) This also makes explicit something that was probably a bug; IP4_NUM_ROUTES is always set, even if it's "0" (while the same is not true of IP6_NUM_ROUTES). (This behavior is preserved for compatibility.)
| * libnm-core: add GVariant-based versions of IP structure-manipulating utilitiesDan Winship2014-09-183-0/+534
| |
| * callouts: port nm-avahi-autoipd.action to GDBusDan Winship2014-09-181-82/+62
|/
* libnm-core: fix crash while converting permissions to listJiří Klimeš2014-09-181-0/+3
| | | | Accept NULL as equivalent to a 0-length array from set_property().
* libnm-core: fix nm_connection_replace_settings()Dan Winship2014-09-171-1/+1
| | | | | | The rewrite mistakenly used nm_connection_add_setting() rather than _nm_connection_add_setting(), causing it to emit the "changed" signal while the connection was only partially rebuilt.
* tui: fix an out-of-date commentDan Winship2014-09-171-5/+2
| | | | | nmtui-connect.c claimed that it didn't implement deactivation yet, but that was implemented long ago.
* Misc libnm-core fixes (bgo #736700)Dan Winship2014-09-1717-275/+210
|\
| * libnm: fix race conditions when creating the same object twiceDan Winship2014-09-171-13/+22
| | | | | | | | | | | | | | | | | | | | | | If two code paths try to asynchronously create the same object at the same time (eg, because it shows up in two different properties), we are supposed to deal with that. But at some point a race condition appeared where we could end up returning a partially-initialized object for one of the properties in the async case. Fix that. Also add comments to both the sync and async cases explaining why they work the way they do.
| * libnm: drop two unnecessary NM_IS_OBJECT() checksDan Winship2014-09-171-4/+2
| | | | | | | | | | Now that NMRemoteConnection is an NMObject, the code only creates NMObjects, so we don't need that check.
| * libnm: fix object-creation-failure codeDan Winship2014-09-171-1/+2
| | | | | | | | | | | | | | If _nm_object_create() hit an error, it would return the (half-initialized) object anyway. If _nm_object_create_async() hit an error, it would return NULL, but leak the half-initialized object. Fix both cases.
| * libnm-core: fix up connection deserialize/copy/replace semanticsDan Winship2014-09-177-132/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libnm-util's connection deserializing/copying/replacing functions have odd semantics where sometimes they both modify a connection AND return an error. libnm-core tried to improve things by guaranteeing that the connection would not be modified if the new settings were invalid, but this ended up breaking a bunch of places that needed to be able to work with invalid connections. So re-fix the functions by reverting back to the old semantics, but having return values that clearly distinguish whether the connection was modified or not. For comparison: - nm_connection_new_from_hash() / nm_simple_connection_new_from_dbus(): - libnm-util: returns a valid connection or NULL. - OLD libnm-core: returned a valid connection or NULL. - NEW libnm-core: returns a valid connection or NULL. - nm_connection_duplicate() / nm_simple_connection_new_clone(): - libnm-util: always succeeds, whether or not the connection is valid. - OLD libnm-core: returned a valid connection or NULL - NEW libnm-core: always succeeds, whether or not the connection is valid. - nm_connection_replace_settings_from_connection(): - libnm-util: always replaces the settings, but returns FALSE if the connection is now invalid. - OLD libnm-core: either replaced the settings and returned TRUE (if the settings were valid), or else left the connection unchanged and returned FALSE (if not). - NEW libnm-core: always replaces the settings, and has no return value. (The modified connection is valid if and only if the replaced-from connection was valid; just like with the libnm-util version.) - nm_connection_replace_settings(): - libnm-util: returns TRUE if the new settings are valid, or FALSE if either (a) the new settings could not be deserialized and the connection is unchanged, or (b) the new settings were deserialized, and the connection was updated, but is now not valid. - OLD libnm-core: either replaced the settings and returned TRUE (if the settings were valid), or else left the connection unchanged and returned FALSE (if not). - NEW libnm-core: returns TRUE if the connection was updated (whether or not it is valid), or FALSE if the new settings could not be deserialized and the connection is unchanged.
| * libnm-core: drop the ability to verify settings from property overridesDan Winship2014-09-178-111/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It needs to be possible to deserialize a connection hash into an invalid NMConnection; in particular, AddAndActivateConnection() explicitly allows this. Previously, the SetFunc and NotSetFunc passed to _nm_setting_class_override_property() could return a verification error immediately, but this functionality has to go away if we're going to be able to deserialize invalid connections. That functionality was only used in the handling of invalid virtual interface names; reorganize how that code works so that NMSettingConnection does all of the verification itself. (The code to make sure that it returned the "correct" error domain in that case turned out to be irrelevant, since the setting error domains don't get serialized over D-Bus correctly anyway.)
| * libnm-core: fix getting/setting 0-length array propertiesDan Winship2014-09-171-5/+10
| | | | | | | | | | | | Empty array-valued properties should return a 0-length array from get_property(), but should also accept NULL as equivalent to a 0-length array from set_property().
| * Revert "tui: fix a crash"Dan Winship2014-09-171-10/+6
|/ | | | This reverts commit c0ecd2f62815606824bc934599dc46b069fe9962.
* core: fix casting of factory type (bgo #736780)Lubomir Rintel2014-09-171-1/+1
| | | | | | | | | | UINT is just 32bit, truncating the GType on 64-bit platforms. We do already use cast to SIZE, which is as wide as a pointer, when we need a GType in another place (nmtui); let's do it here as well. Broken by [0bc1b5138] core: add support for internal device factories https://bugzilla.gnome.org/show_bug.cgi?id=736780
* po: update Assamese (as) translation (bgo #736753)Nilamdyuti Goswami2014-09-161-1334/+1042
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=736753
* tui: fix error: ‘return’ with no value, in function returning non-voidJiří Klimeš2014-09-161-1/+1
|
* po: update POTFILES.in for nmtui PPPoE filesDan Winship2014-09-161-0/+2
|
* tui: add support for editing DSL connections (rh #1105753)Dan Winship2014-09-1617-68/+603
|\
| * tui: add support for editing DSL connections (rh #1105753)Dan Winship2014-09-167-2/+488
| |
| * tui: reorganize page-creation code a bitDan Winship2014-09-169-52/+66
| | | | | | | | | | Allow each page type to specify whether it should be shown by default, letting us simplify NmtPageMain.
| * tui: add support for borderless NmtNewtSectionsDan Winship2014-09-163-14/+49
|/
* core: only set IPv6 hop_limit for values greater than zeroChristian Hesse2014-09-151-1/+3
| | | | | A "Cur Hop Limit" field value of 0 in a router advertisement means "unspecified by this router" and should not be set in the kernel.
* tui: fix a crashDan Winship2014-09-151-6/+10
| | | | NMSettingIP4Config:dns is NULL if no DNS servers are set
* dhcp: log DHCP client exit status betterJiří Klimeš2014-09-121-13/+22
|
* dhcp: fix dhclient abnormal exit due to SIGPIPE (bgo #735962)Jiří Klimeš2014-09-122-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | DHCP client may be killed by SIGPIPE when attempting to write to a broken pipe. This can be observed, for example, when journald is restarted. Fix that by redirecting both stdout and stderr to /dev/null. The client logs into syslog anyway. When NetworkManager is run with '--debug' we duplicate syslog to stderr, so the messages goes to terminal as well. Testcase: - start a NetworkManager service by systemd - activate an DHCP ethernet connection - sudo systemctl restart systemd-journald.service - reactive the ethernet connection (nmcli con up <my-eth>) - DHCP client is killed by SIGPIPE right after its startup: <info> (enp0s25): DHCPv4 client pid 13959 exited with status -1 <warn> DHCP client died abnormally Another possible fix would be ignoring SIGPIPE in the DHCP client as it is not useful in most cases. E.g. systemd ignores SIGPIPE for its services, by default: http://cgit.freedesktop.org/systemd/systemd/commit/?id=353e12c2f4a9e96a47eb80b80d2ffb7bc1d44a1b https://bugzilla.gnome.org/show_bug.cgi?id=735962
* build: fix build after "settings: create default wired connection..."Dan Williams2014-09-111-1/+0
| | | | Fix build broken by beb18050b5a00a704a74bff5c10919b44f087122
* merge: create internal device types with factories too (bgo #736289)Dan Williams2014-09-1147-863/+934
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=736289
| * tun: port to internal device factorydcbw/internal-device-factoriesDan Williams2014-09-115-38/+36
| |
| * gre: port to internal device factoryDan Williams2014-09-115-29/+28
| |
| * vxlan: port to internal device factoryDan Williams2014-09-115-28/+28
| |