summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* TEST: add debug logging (TODO)th/queue_act_request_no_carrier_rh1079353Thomas Haller2015-02-246-1/+26
| | | | | | | | | | | | | | | reproducer: - start NM with cable unplugged. - NM will be waiting indefinitely for carrier - `nmcli connection up C` hangs - in another terminal: `nmcli connection up C`, see that now both hang. - in another termina: `nmcli connection up C`, see that the first invokation returns. It seems that libnm's 'active-connection-removed' signal is broken. And what is with 'active-connection-added'? Is it wired up correctly?
* core: merge branch 'th/queue_act_request_no_carrier_rh1079353'Thomas Haller2015-02-2411-157/+263
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1079353
| * device: accept user activation request while waiting for carrierThomas Haller2015-02-243-13/+110
| | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1079353
| * device: eliminate direct calls to check_connection_available() in favor of ↵Thomas Haller2015-02-244-67/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_device_check_connection_available() It was confusing to understand the difference between calling nm_device_connection_is_available() and check_connection_available(), they behaved similar, but not really the same. Especially nm_device_connection_is_available() would look first into @available_connetions, and might call check_connection_available() itself. Whereas @available_connetions was also populated by testing check_connection_available(). This interrelation makes it hard to understand when nm_device_connection_is_available() returned true. Rename nm_device_connection_is_available() to nm_device_check_connection_available() and remove all direct calls of check_connection_available() in favor of the wrapper nm_device_check_connection_available(). Now we only call nm_device_check_connection_available() with different parameters (@flags and @specific_object). We also have the additional guarantee that specifying more @flags will widen the result and making a connection "more" available, while specifying a @specific_object will restrict it. This also changes behavior in several cases. For example before nm_device_connection_is_available() for user-requests would always declare matching connections available on Wi-Fi devices (only) regardless of the device state. Now the device state gets consistently considered. For default-unmanaged devices it also changes behavior in complicated ways, because before we would put connections into @available_connetions for every device-state, but nm_device_connection_is_available() had a special over-ride only for unmanaged-state. This also fixes a bug, that user can activate an unavailable Wi-Fi device: nmcli radio wifi off nmcli connection up wlan0
| * device: remove debug logging from is_available()Thomas Haller2015-02-243-30/+10
| | | | | | | | | | | | | | | | | | Having logging statements in a simple getter (or is_*()) means you cannot call these functions without cluttering the log. Another approach would be to add an @out_reason argument, and callers who actually care log the reason. For now, just get rid of the messages.
| * device: implement flag NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER for ↵Thomas Haller2015-02-242-1/+9
| | | | | | | | is_available()
| * device: add flags to nm_device_is_available()Thomas Haller2015-02-2411-24/+35
| |
| * device: add flags argument to check_connection_available()Thomas Haller2015-02-249-18/+38
| |
| * device: merge check_connection_available_wifi_hidden() into ↵Thomas Haller2015-02-249-37/+33
| | | | | | | | | | | | check_connection_available() Only refactoring, no behavioral change.
| * device: refactor nm_device_connection_is_available()Thomas Haller2015-02-241-17/+31
| | | | | | | | | | No functional change, but refactor the function to return early.
| * device/trivial: rename argument in nm_device_connection_is_available()Thomas Haller2015-02-242-5/+7
| | | | | | | | | | | | | | | | | | | | The argument name should express what the caller wants (he wants to know, whether the connection can be activated for an internal or external activation request). Whether that involves checking device-specific overrides, is not the point -- nm_device_check_connection_compatible() is also a virtual function with device-specific overrides.
| * device: fix leaking queued NMActiveConnectionThomas Haller2015-02-241-3/+12
| | | | | | | | | | | | The queued activation request must transition state to DEACTIVATED, otherwise it is not removed from the list of active_connections in NMManager.
| * device: add special NM_UNMANAGED_ALL flagThomas Haller2015-02-241-1/+2
| |
| * device: don't remove and re-add pending action in nm_device_bring_up()Thomas Haller2015-02-241-4/+3
| |
| * device: don't add dummy value to @available_connections hashThomas Haller2015-02-241-3/+2
|/ | | | | GHashTable is optimized for usage of a set, where the key equals the value. Don't add a dummy value.
* core: merge branch 'th/spec-match-bgo743411'Thomas Haller2015-02-2410-135/+431
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=743411
| * man: explain the format for device specifier in manual page NetworkManager.confThomas Haller2015-02-241-21/+89
| |
| * core: unify parsing of device specs using nm_match_spec_split()Thomas Haller2015-02-243-51/+31
| | | | | | | | | | | | | | | | | | | | | | | | There are three configuration options that contain device specs: 'main.ignore-carrier', 'main.no-auto-default', and 'keyfile.unmanaged-devices'. Unify the parsing of them by splitting the device spec with nm_match_spec_split(). This changes behavior for parsing of these properties. Also get rid of logging warnings when parsing 'keyfile.unmanaged-devices'.
| * core: add nm_match_spec_split() functionThomas Haller2015-02-243-9/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are currently three device spec properties: 'main.ignore-carrier', 'main.no-auto-default' and 'keyfile.unmanaged-devices'. The first two, called g_key_file_parse_value_as_string() to split the string into individual device specs. This uses ',' as separator and supports escaping using '\\'. 'keyfile.unmanaged-devices' is split using ',' or ';' as separator without supporting escaping. Add a new function nm_match_spec_split(), to unify these two behaviors and support both formats. That is, both previous formats are mostly supported, but obviously there are some behavioral changes if the string contains one of '\\', ',', or ';'. nm_match_spec_split() is copied from glibs g_key_file_parse_value_as_string() and adjusted.
| * core: support "except:" spec to negate matchThomas Haller2015-02-246-53/+120
| | | | | | | | | | | | | | | | | | | | Extend nm_match_spec_*() to support an "except:" prefix to negate the result of a match. "except:" only works when followed by an exact match type, for example "except:interface-name:vboxnet0", but not "except:vboxnet0". A matching "except:" spec always wins, regardless of other positive matchings.
| * core: remove nm_match_spec_string()Thomas Haller2015-02-243-16/+5
| | | | | | | | | | It was only used to match against "*", in a case-insensitive way.
| * core: rework matching of nm_match_spec()Thomas Haller2015-02-242-21/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes several changes how to match device specs: - matching the interface name is no longer case-insenstive as interface names themselves are case-sensitive. - Now we skip patterns that start with "mac:" or "s390-subchannels:" for comparing interface names. Previously a spec "mac:1" would have matched an interface named "mac:1", now it doesn't. To match such an interface, you would have to specify "interface-name:mac:1". - previously, a pattern "a" would have matched an interface named "interface-name:a", now it doesn't. Since valid interface name (in the kernel) can be at most 15 characters long, this is however no problem. - if the spec has the prefix "interface-name:", we support simple globbing using GPatternSpec. Globbing without exact spec type will still not match "vboxnet*" -- with the exception of "*". You can disable globbing by putting an '=' immediately after the ':'. (a) "interface-name:em1" | matches "em1" (b) "interface-name:em*" | matches "em", "em1", "em2", etc. (c) "interface-name:em\*" | matches "em\", "em\1", etc. (d) "interface-name:=em*" | matches "em*" (e) "em*" | matches "em*"
| * core/test: add test for nm_match_spec()Thomas Haller2015-02-241-0/+84
|/
* cli/completion: add completion for --colors optionThomas Haller2015-02-231-1/+8
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=738613 Fixes: 758e488f13140e55581c756ebab5ed7edb716f65
* keyfile: merge branch 'th/keyfile-escape-file-bgo735824'Thomas Haller2015-02-234-46/+128
|\ | | | | | | | | | | | | | | This changes behavior, in that we now ignore keyfiles that start with a dot ('.'). This means, that connection with ids starting with a dot, will be ignored. https://bugzilla.gnome.org/show_bug.cgi?id=735824
| * keyfile: ignore all dot files (bgo#735824)Pavel Šimerda2015-02-232-15/+14
| | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=735824
| * keyfile: add nm_keyfile_plugin_utils_escape_filename() functionThomas Haller2015-02-234-30/+113
| | | | | | | | | | | | | | | | We have nm_keyfile_plugin_utils_should_ignore_file() to ignore certain files based on patterns. We also need a matching escape function to avoid saving connections with a name we would ignore later. https://bugzilla.gnome.org/show_bug.cgi?id=735824
| * keyfile: use locale independent g_ascii_strcasecmp()Thomas Haller2015-02-231-2/+2
|/ | | | https://bugzilla.gnome.org/show_bug.cgi?id=735824
* man: fix small typo in nmcli man pageBastien Nocera2015-02-231-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=745007
* merge: nmcli: sort connections and add colors to nmcli output (bgo #738613)Jiří Klimeš2015-02-238-141/+658
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=738613
| * nmcli: colorize 'general', 'radio' and 'networking' outputsJiří Klimeš2015-02-231-19/+70
| |
| * nmcli: show devices list in colorsJiří Klimeš2015-02-231-1/+13
| |
| * nmcli: show connection list in colorsJiří Klimeš2015-02-231-1/+15
| | | | | | | | | | | | | | | | Colorize active connections as follows: activated - green activating - yellow deactivating/deactivated - red invisible active connections - dimmed
| * nmcli: add global '--colors' option for controlling color outputJiří Klimeš2015-02-234-5/+41
| | | | | | | | | | | | nmcli -c auto -> colors will only be used when stdout is a terminal nmcli -c yes -> colors will be enabled unconditionally nmcli -c no -> colors will be disabled unconditionally
| * nmcli: add support for terminal formatting, like bold, dim, underline, etc.Jiří Klimeš2015-02-234-19/+76
| |
| * nmcli: add support for printing color stringsJiří Klimeš2015-02-233-29/+88
| |
| * nmcli: pay attention to color escape sequencies when counting string lengthJiří Klimeš2015-02-231-5/+34
| | | | | | | | This is to properly align the columns on screen.
| * nmcli: make filtering color sequences a utility functionJiří Klimeš2015-02-233-19/+45
| | | | | | | | The code will be used on other places too.
| * nmcli: add --order option for 'nmcli connection show'Jiří Klimeš2015-02-232-28/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option allows you to specify custom sorting order. Default order (when no --order is provided) corresponds to -o "active:name:path" Examples: nmcli con show -o name nmcli con show -o +name - sort connections by name alphabetically nmcli con show -o -name - sort connections by name alphabetically in reverse order mmcli con show -o active:name - sort connections first by active status, then by name mmcli con show -o -path - sort connections by D-Bus path in reverse order
| * nmcli: sort connections in 'nmcli connection show' outputJiří Klimeš2015-02-231-40/+143
| |
| * nmcli: (trivial): use real parameter types in fill_output_connection() prototypeJiří Klimeš2015-02-231-3/+1
|/ | | | | The generic pointers were remnants from the time the function was used as a callback.
* po: update Swedish (sv) translation (bgo #744937)Josef Andersson2015-02-221-2380/+2567
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744937
* keyfile/writer: fix password_raw_writer() to write NMSetting8021x:password-rawThomas Haller2015-02-192-11/+31
| | | | | | | | | | | After refactoring libnm-core to use GBytes instead of GByteArray/DBUS_TYPE_G_UCHAR_ARRAY, it was forgotten to update keyfile writer. This causes keyfile writer to skip the NMSetting8021x:password-raw setting and raise a g_critical() warning. Fixes: c43f88907be66f8f62a8edbe76ae2aec4ff61190
* merge: fix errors found with valgrindLubomir Rintel2015-02-189-10/+20
|\ | | | | | | A handful of memory leaks and one read-after-free().
| * build: don't run tests with valgrind by defaultlr/valgrindLubomir Rintel2015-02-181-3/+3
| | | | | | | | | | Only enable it when user requested it. The surpressions might not work for everyone.
| * manager: memleak: free the state file name on disposeLubomir Rintel2015-02-181-0/+1
| | | | | | | | | | | | | | | | | | ==12663== 45 bytes in 1 blocks are definitely lost in loss record 2,464 of 4,708 ==12663== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==12663== by 0x7F4A6F5: g_malloc (gmem.c:97) ==12663== by 0x7F6301E: g_strdup (gstrfuncs.c:356) ==12663== by 0x4B8AE5: nm_manager_new (nm-manager.c:4793) ==12663== by 0x432F3D: main (main.c:413)
| * agent-manager: memleak: unref the last agent for a request tooLubomir Rintel2015-02-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==29353== 620 (+620) (32 (+32) direct, 588 (+588) indirect) bytes in 1 (+1) blocks are definitely lost in loss record 6,905 of 7,076 ==29353== at 0x7CDBAC8: g_type_create_instance (gtype.c:1844) ==29353== by 0x7CBF356: g_object_new_internal (gobject.c:1774) ==29353== by 0x7CC0D4C: g_object_newv (gobject.c:1922) ==29353== by 0x7CC14E3: g_object_new (gobject.c:1614) ==29353== by 0x50B58A: nm_secret_agent_new (nm-secret-agent.c:489) ==29353== by 0x50915F: impl_agent_manager_register_with_capabilities (nm-agent-manager.c:309) ==29353== by 0x62649BE: invoke_object_method (dbus-gobject.c:1899) ==29353== by 0x62649BE: object_registration_message (dbus-gobject.c:2161) ==29353== by 0x649D5CE: _dbus_object_tree_dispatch_and_unlock (dbus-object-tree.c:1018) ==29353== by 0x648F193: dbus_connection_dispatch (dbus-connection.c:4718) ==29353== by 0x6261DB4: message_queue_dispatch (dbus-gmain.c:90) ==29353== by 0x7F44AEA: g_main_dispatch (gmain.c:3111) ==29353== by 0x7F44AEA: g_main_context_dispatch (gmain.c:3710) ==29353== by 0x7F44E87: g_main_context_iterate.isra.29 (gmain.c:3781)
| * auth-utils: memleak: free the key when we steal dataLubomir Rintel2015-02-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==5177== 6 (+6) bytes in 1 (+1) blocks are definitely lost in loss record 118 of 6,581 ==5177== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==5177== by 0x7F4A6F5: g_malloc (gmem.c:97) ==5177== by 0x7F6301E: g_strdup (gstrfuncs.c:356) ==5177== by 0x4AD902: nm_auth_chain_set_data (nm-auth-utils.c:194) ==5177== by 0x50919E: impl_agent_manager_register_with_capabilities (nm-agent-manager.c:323) ==5177== by 0x62649BE: invoke_object_method (dbus-gobject.c:1899) ==5177== by 0x62649BE: object_registration_message (dbus-gobject.c:2161) ==5177== by 0x649D5CE: _dbus_object_tree_dispatch_and_unlock (dbus-object-tree.c:1018) ==5177== by 0x648F193: dbus_connection_dispatch (dbus-connection.c:4718) ==5177== by 0x6261DB4: message_queue_dispatch (dbus-gmain.c:90) ==5177== by 0x7F44AEA: g_main_dispatch (gmain.c:3111) ==5177== by 0x7F44AEA: g_main_context_dispatch (gmain.c:3710) ==5177== by 0x7F44E87: g_main_context_iterate.isra.29 (gmain.c:3781) ==5177== by 0x7F451B1: g_main_loop_run (gmain.c:3975)
| * connectivity: memleak: drop async result reference on completeLubomir Rintel2015-02-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==5177== 104 (+104) bytes in 1 (+1) blocks are definitely lost in loss record 5,502 of 6,581 ==5177== at 0x4C29BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==5177== by 0x7F4A6F5: g_malloc (gmem.c:97) ==5177== by 0x7F6159F: g_slice_alloc (gslice.c:1007) ==5177== by 0x7F61B6D: g_slice_alloc0 (gslice.c:1032) ==5177== by 0x7CDB9A3: g_type_create_instance (gtype.c:1847) ==5177== by 0x7CBF356: g_object_new_internal (gobject.c:1774) ==5177== by 0x7CC0D4C: g_object_newv (gobject.c:1922) ==5177== by 0x7CC14E3: g_object_new (gobject.c:1614) ==5177== by 0x79A4C57: g_simple_async_result_new (gsimpleasyncresult.c:319) ==5177== by 0x515B34: nm_connectivity_check_async (nm-connectivity.c:289) ==5177== by 0x515D74: run_check (nm-connectivity.c:217) ==5177== by 0x515DBF: idle_start_periodic_checks (nm-connectivity.c:229)
| * linux-platform: dont use-after-free the driver stringLubomir Rintel2015-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==1345== Invalid read of size 1 ==1345== at 0x827DC15: vfprintf (vfprintf.c:1642) ==1345== by 0x8345D04: __vasprintf_chk (vasprintf_chk.c:66) ==1345== by 0x7F882DB: vasprintf (stdio2.h:210) ==1345== by 0x7F882DB: g_vasprintf (gprintf.c:316) ==1345== by 0x7F6319C: g_strdup_vprintf (gstrfuncs.c:507) ==1345== by 0x7F63258: g_strdup_printf (gstrfuncs.c:533) ==1345== by 0x472833: nm_platform_link_to_string (nm-platform.c:2337) ==1345== by 0x472A05: log_link (nm-platform.c:2754) ==1345== by 0x9DC5D5F: ffi_call_unix64 (unix64.S:76) ==1345== by 0x9DC57D0: ffi_call (ffi64.c:525) ==1345== by 0x7CBA553: g_cclosure_marshal_generic (gclosure.c:1448) ==1345== by 0x7CB9D34: g_closure_invoke (gclosure.c:768) ==1345== by 0x7CCB34B: signal_emit_unlocked_R (gsignal.c:3483) ==1345== Address 0xa91b5a0 is 0 bytes inside a block of size 5 free'd ==1345== at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==1345== by 0x68E7D6D: link_free_data (link.c:223) ==1345== by 0x6D47B1F: nl_object_free (object.c:186) ==1345== by 0x46C31C: put_nl_object (nm-linux-platform.c:222) ==1345== by 0x46C31C: link_change (nm-linux-platform.c:2354) ==1345== by 0x46C87F: link_set_user_ipv6ll_enabled (nm-linux-platform.c:2583) ==1345== by 0x4476C4: set_nm_ipv6ll (nm-device.c:4418) ==1345== by 0x4476C4: ip6_managed_setup (nm-device.c:7515) ==1345== by 0x453F12: _set_state_full (nm-device.c:7665) ==1345== by 0x4B6609: add_device (nm-manager.c:1885) ==1345== by 0x4B6880: system_create_virtual_device (nm-manager.c:1126) ==1345== by 0x4B6B40: system_create_virtual_devices (nm-manager.c:1163) ==1345== by 0x4B6E00: platform_link_added (nm-manager.c:2213) ==1345== by 0x4B6E00: platform_link_cb (nm-manager.c:2228) ==1345== by 0x9DC5D5F: ffi_call_unix64 (unix64.S:76)