summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core: log connection change with nm_utils_log_connection_diff()th/bgo737380_log_connection_diffThomas Haller2014-10-072-0/+4
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: add nm_utils_log_connection_diffThomas Haller2014-10-073-0/+305
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add _nm_setting_get_property() functionThomas Haller2014-10-074-0/+46
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm: add function _nm_setting_get_setting_priority()Thomas Haller2014-10-074-4/+29
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: let nm_setting_diff() be symetric not to return properties that ↵Thomas Haller2014-10-074-22/+144
| | | | | | | | | | | | | | | | are set to default Previously, nm_setting_diff() (and thus nm_connection_diff()), returned only properties that are different AND not set to the default value. However, if the opposite setting 'B' was missing, it would always include all properties from 'A', even the default ones. This behaviour was asymetric. Add two new compare flags @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_WITH_DEFAULT and @NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT to control the behaviour of whether to include default properties. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm: hide API for generic handling of secretsThomas Haller2014-10-075-30/+11
| | | | | | | | The functions nm_setting_clear_secrets(), nm_setting_clear_secrets_with_flags(), and nm_setting_need_secrets() are not used outside of libnm-core. Remove them from public API. Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! libnm-util: don't assert in nm_setting_get_secret_flags() and avoid ↵Thomas Haller2014-10-078-56/+43
| | | | assertion in agent_secrets_done_cb()
* libnm-util: don't assert in nm_setting_get_secret_flags() and avoid ↵Thomas Haller2014-10-079-39/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertion in agent_secrets_done_cb() When secret providers return the connection hash in GetSecrets(), this hash should only contain secrets. However, some providers also return non-secret properties. for_each_secret() iterated over all entries of the @secrets hash and triggered the assertion in nm_setting_get_secret_flags() (see below). NM should not assert against user provided input. Change nm_setting_get_secret_flags() to silently return FALSE, if the property is not a secret. Indeed, handling of secrets is very different for NMSettingVpn and others. Hence nm_setting_get_secret_flags() has only an inconsistent behavior and we have to fix all call sites to do the right thing (depending on whether we have a VPN setting or not). Now for_each_secret() checks whether the property is a secret without hitting the assertion. Adjust all other calls of nm_setting_get_secret_flags(), to anticipate non-secret flags and assert/warn where appropriate. Also, agent_secrets_done_cb() clears now all non-secrets properties from the hash, using the new argument @remove_non_secrets when calling for_each_secret(). #0 0x0000003370c504e9 in g_logv () from /lib64/libglib-2.0.so.0 #1 0x0000003370c5063f in g_log () from /lib64/libglib-2.0.so.0 #2 0x00007fa4b0c1c156 in get_secret_flags (setting=0x1e3ac60, secret_name=0x1ea9180 "security", verify_secret=1, out_flags=0x7fff7507857c, error=0x0) at nm-setting.c:1091 #3 0x00007fa4b0c1c2b2 in nm_setting_get_secret_flags (setting=0x1e3ac60, secret_name=0x1ea9180 "security", out_flags=0x7fff7507857c, error=0x0) at nm-setting.c:1124 #4 0x0000000000463d03 in for_each_secret (connection=0x1deb2f0, secrets=0x1e9f860, callback=0x464f1b <has_system_owned_secrets>, callback_data=0x7fff7507865c) at settings/nm-settings-connection.c:203 #5 0x000000000046525f in agent_secrets_done_cb (manager=0x1dddf50, call_id=1, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_username=0x1e51710 "thom", agent_has_modify=1, setting_name=0x1e91f90 "802-11-wireless-security", flags=NM_SETTINGS_GET_SECRETS_FLAG_ALLOW_INTERACTION, secrets=0x1e9f860, error=0x0, user_data=0x1deb2f0, other_data2=0x477d61 <get_secrets_cb>, other_data3=0x1ea92a0) at settings/nm-settings-connection.c:757 #6 0x00000000004dc4fd in get_complete_cb (parent=0x1ea6300, secrets=0x1e9f860, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_username=0x1e51710 "thom", error=0x0, user_data=0x1dddf50) at settings/nm-agent-manager.c:1139 #7 0x00000000004dab54 in req_complete_success (req=0x1ea6300, secrets=0x1e9f860, agent_dbus_owner=0x1ddb9e0 ":1.39", agent_uname=0x1e51710 "thom") at settings/nm-agent-manager.c:502 #8 0x00000000004db86e in get_done_cb (agent=0x1e89530, call_id=0x1, secrets=0x1e9f860, error=0x0, user_data=0x1ea6300) at settings/nm-agent-manager.c:856 #9 0x00000000004de9d0 in get_callback (proxy=0x1e47530, call=0x1, user_data=0x1ea10f0) at settings/nm-secret-agent.c:267 #10 0x000000337380cad2 in complete_pending_call_and_unlock () from /lib64/libdbus-1.so.3 #11 0x000000337380fdc1 in dbus_connection_dispatch () from /lib64/libdbus-1.so.3 #12 0x000000342800ad65 in message_queue_dispatch () from /lib64/libdbus-glib-1.so.2 #13 0x0000003370c492a6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #14 0x0000003370c49628 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0 #15 0x0000003370c49a3a in g_main_loop_run () from /lib64/libglib-2.0.so.0 #16 0x000000000042e5c6 in main (argc=1, argv=0x7fff75078e88) at main.c:644 Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix setting secrets flagsJiří Klimeš2014-10-061-19/+28
|
* test: fix check-local in Makefile to print newline after messageThomas Haller2014-10-061-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix setting SSID property in the editorJiří Klimeš2014-10-061-5/+4
| | | | SSID is now GBytes, not GByteArray.
* tui: fix accessing NULL in g_bytes_get_data()Jiří Klimeš2014-10-061-4/+10
| | | | | | | | | | | GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed Additional fixes to commit 4359e556e41febb2dcf9e86ad72bcdef42fa879e.
* logging: merge branch 'th/bgo737593_log_trace'Thomas Haller2014-10-0512-23/+31
|\ | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=737593 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core/dbus: log messages in nm-dbus-manager.c with "TRACE" priorityThomas Haller2014-10-051-4/+2
| | | | | | | | | | | | | | The messages logged by nm-dbus-manager.c are not very useful, but amount to a significant part of DEBUG logging. Log those messages with the lower TRACE priority. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * logging: add new logging level "TRACE"Thomas Haller2014-10-0511-19/+29
|/ | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm, libnm-glib: clarify nm_client_activate_connection() semanticsDan Winship2014-10-052-2/+14
| | | | | | | | | nm_client_activate_connection() and nm_client_add_and_activate_connection() return when the activation has *started*, not when it *finishes*. Clarify this a bit more in the libnm docs, and copy that clarification to libnm-glib as well. https://bugzilla.gnome.org/show_bug.cgi?id=736233
* device: drop leftover bad assertLubomir Rintel2014-10-051-1/+1
| | | | | | | | | | | | NetworkManager:ERROR:devices/nm-device.c:7089:nm_device_update_hw_address: assertion failed: (hwaddrlen <= sizeof (priv->hw_addr)) Aborted (core dumped) Breaks 32-bit, works on 64-bit by dumb luck. https://bugzilla.gnome.org/show_bug.cgi?id=737900 Fixes: b019348fdde223f39c91150e6b7a11e366fade63 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm: make use of GParamSpecFlags and GParamSpecEnum (bgo #737485)Dan Winship2014-10-0335-277/+619
|\
| * libnm-core: make NMSettingSerial:parity an enumDan Winship2014-10-0311-20/+201
| | | | | | | | | | | | NMSettingSerial:parity was defined as a char-typed property that could have the (case-sensitive!) values 'n', 'E', or 'o'. This is zany. Add an NMSettingSerialParity enum, and use that instead.
| * libnm: make use of GParamSpecFlags and GParamSpecEnumDan Winship2014-10-0325-236/+387
| | | | | | | | | | | | | | | | | | | | Make enum- and flags-valued properties use GParamSpecEnum and GParamSpecFlags, for better introspectability/bindability. This requires no changes outside libnm-core/libnm since the expected data size is still the same with g_object_get()/g_object_set(), and GLib will internally convert between int/uint and enum/flags GValues when using g_object_get_property()/g_object_set_property().
| * libnm: reorganize demarshal_generic(), make unrecognized type a warningDan Winship2014-10-031-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | Redo the HANDLE_TYPE macro in demarshal_generic() in a more syntactically-sane way (both to help the editor with indentation and to make it not look so weird). Also, if demarshal_generic() is asked to handle a property of a type that it doesn't know how to handle, that's a programmer error, so do a g_warning() in that case (as opposed to being asked to demarshal a value of the wrong D-Bus type, which could just be a bug in the peer that sent the data, so that stays as a debug message).
| * libnm: fix properties-changed debug loggingDan Winship2014-10-031-5/+5
|/ | | | | | | | The code was mistakenly still using G_VALUE_TYPE_NAME() instead of g_variant_get_type_string(). Also, refer to the properties with standard gtk-doc punctuation: "TypeName:property-name".
* bond: fix setting bond option 'lacp_rate'Thomas Haller2014-10-031-1/+4
| | | | | | | | | | | | | | Setting 'lacp_rate' is only possible in '802.3ad' (4) mode. Otherwise writing to sysctl fails and results in the following error log: <error> [1412337854.026285] [platform/nm-linux-platform.c:2093] sysctl_set(): sysctl: failed to set '/sys/class/net/nm-bond/bonding/lacp_rate' to '0': (13) Permission denied <warn> (nm-bond): failed to set bonding attribute 'lacp_rate' to '0' Related: https://bugzilla.redhat.com/show_bug.cgi?id=1061702 Fixes: 47555449fa1b66604ea6645eb6fd97fc131cbc9e Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: fix compilation with GLib 2.32Jiří Klimeš2014-10-031-0/+1
|
* contrib/rpm: detect ppp version based on installed packageThomas Haller2014-10-031-1/+1
| | | | | | | | Also fixes build failure if user had no /sbin/pppd in its $PATH. https://bugzilla.gnome.org/show_bug.cgi?id=736954 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm: merge branch 'th/bgo737725-libnm-private-dbus-connection'Thomas Haller2014-10-034-13/+128
|\ | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=737725 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm: share private DBUS connectionThomas Haller2014-10-031-7/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache the private DBUS connection and reuse it. Otherwise we end up creating several private connnections, as an NMObject instance creates a new connection (unless it is passed in as NMObject:dbus-connection property). We already pass the existing "parent" DBUS connection when creating the proxy objects. However, when creating two independent objects (e.g. nm_client_new() and nm_remote_settings_new()), their private DBUS connections were not shared. Implement this sharing inside nm-dbus-helpers.c https://bugzilla.gnome.org/show_bug.cgi?id=737725 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm: add NMObject:dbus-connection property to inject DBUS connectionThomas Haller2014-10-032-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b732380d1eb86d4278578559b0ec00990202e3fc removed the gobject property "NMObject:connection". However, this property is still needed to inject the DBUS connection when creating new proxy objects. Without it, we call _nm_dbus_new_connection() in the constructor for every proxy NMObject. In case of non-private connections, g_bus_get_sync() already returns the same connection. However for private connections, g_dbus_connection_new_for_address_sync() would create a separate DBUS connection. https://bugzilla.gnome.org/show_bug.cgi?id=737725 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm: assert for interface name in _nm_object_class_add_interface()Thomas Haller2014-10-031-0/+3
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm: remove unused variable NMObjectPrivate:private_connectionThomas Haller2014-10-031-1/+0
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core/dbus: debug log unix file descriptor when closing private dbus connectionThomas Haller2014-10-031-4/+5
|/ | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* contrib/rpm: fix --quick option of build_clean.shThomas Haller2014-10-031-0/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* merge: fix DHCP 'expire' state handling (rh #1139326) (bgo #737225)Dan Williams2014-10-022-3/+9
|\
| * dhcp: treat lease expiry as failure (rh #1139326)Dan Williams2014-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lease expiry means that the DHCP configuration is no longer valid, and that all attempts to renew/rebind the lease have failed. The IP config needs to be removed. NetworkManager also sets prefered/valid lifetimes on addresses, so the kernel will remove them when the lease expires anyway. That causes removal of the default route, if the default route was through the device whose config has now expired. DHCP clients will typically move to the 'renew' or 'rebind' states when nearing lease expiry, then if no answer is received move to the 'expire' state. Eventually they move to the 'fail' state when all attempts to contact the server have failed. Previously, since NM ignored the 'expire' DHCP state it would not clear out the DHCP IP4 config immediately when the lease expired, instead waiting for the DHCP client to move to the 'fail' state. But if the DHCP server appeared between the 'expire' and 'fail' states, NM would not notice and the device's NMIP4Config would not change, and thus the Policy would not get the "ip4-config-changed" signal to re-add the default route that the kernel had previously removed due to the valid lifetime reaching zero when the lease expired. https://bugzilla.redhat.com/show_bug.cgi?id=1139326
| * dhcp: fail the device if DHCP fails after having succeeded earlier (rh #1139326)Dan Williams2014-10-021-2/+6
|/ | | | | | | | | If DHCP fails to renew or rebind a lease, fail the device since the IP config is no longer valid. Commit e2b7c482 was actually wrong for dhcp[4|6]_fail(), since (ip_state == IP_FAIL) will never be true if DHCP has ever been started, as IP_FAIL is only set from nm_device_activate_ip[4|6]_config_timeout(), which obviously will not be called in DHCP code paths if DHCP has previously succeeded.
* tui: fix an NmtMacEntry bug introduced when changing hwaddrs to stringsDan Winship2014-10-021-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1148921
* merge branch 'th/rh1061702_bond_options'Thomas Haller2014-10-027-4/+71
|\ | | | | | | | | | | | | | | Add bonding option 'lacp_rate'. https://bugzilla.redhat.com/show_bug.cgi?id=1061702 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * cli: support new bond option 'lacp_rate'Thomas Haller2014-10-022-4/+36
| | | | | | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
| * libnm: add bonding option "lacp_rate" to NMSettingBondThomas Haller2014-10-025-0/+35
|/ | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* contrib/rpm: don't hardwire a single ppp versionLubomir Rintel2014-10-021-6/+2
| | | | | | | | Build against whatever is actually present. https://bugzilla.gnome.org/show_bug.cgi?id=736954 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: minor fix in nm_utils_kill_child_sync() having side-effects in MIN() ↵Thomas Haller2014-10-021-1/+1
| | | | | | macro (again) Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: minor fix in nm_utils_kill_child_sync() having side-effects in MIN() macroThomas Haller2014-10-011-1/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix NetworkManager.pot after renmaing network-manager.[ch] to general.[ch]Thomas Haller2014-10-011-1/+1
| | | | | Fixes: f5850859075074e3dc97b5b372bda3b7672dbe01 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm: return errors in nm_client_networking_set_enabled()Jiří Klimeš2014-10-014-19/+24
| | | | | and do not print an error in the library. The caller can decide what to do on an error.
* cli: strip errors from D-Bus before presenting to a userJiří Klimeš2014-10-013-24/+41
|
* cli: rename network-manager.[ch] to general.[ch]Jiří Klimeš2014-10-014-10/+10
|
* libnm: fix argument type passed to RequestScan() D-Bus callJiří Klimeš2014-10-011-3/+3
| | | | GLib-ERROR **: g_variant_new: expected GVariant of type `a{sv}' but received value has type `aa{sv}'
* build: support building against libsystemd >= 209 libraryMichael Biebl2014-09-301-3/+6
| | | | | | | | | In systemd v209, the various libraries were merged into a single libsystemd library [1]. Add support for building against this new library and fall back to the old library names if not found. [1] http://lists.freedesktop.org/archives/systemd-devel/2014-February/017146.html
* devices: fix default ethernet connection codeDan Winship2014-09-301-5/+1
| | | | | | | | Creation of default wired connections got broken by an incomplete rebase of dcbw/internal-device-factories after danw/libnm-props landed. https://bugzilla.gnome.org/show_bug.cgi?id=737273
* libnm: g_variant_new() for strings does not allow NULLsJiří Klimeš2014-09-301-0/+5
| | | | | | So pass "" instead of NULL. GLib-CRITICAL **: g_variant_new_string: assertion `string != NULL' failed