summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* contrib/rpm: no longer package the Changelog with the libnm-devel/glib-devel ↵th/ChangelogThomas Haller2017-02-141-2/+2
| | | | packages
* Changelog: remove and replace the changelog by a stubThomas Haller2017-02-141-22182/+8
|
* wifi: introduce enum type NMSupplicantInterfaceState instead of plain intThomas Haller2017-02-145-80/+65
| | | | | | | | | 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
* build: simplify (un)install hooks for man pagesThomas Haller2017-02-141-14/+11
|
* build: combine handling of setting docs and man pagesThomas Haller2017-02-143-38/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Building the man pages via xsltproc requires "docbook.xsl" which is part of docbook. Previously, we would build the man pages solely based on "--enable-introspection", which checks for the presence of xsltproc, but not docbook. This can lead to build failure when docbook is not available, but "--enable-introspection" is given. Instead of adding yet another configure option to fine-tune and say "--with-docbook --disable-gtk-doc", just simplify it. Now, documentation (both man pages and setting docs) will be generated with "--enable-gtk-doc" and "--enable-introspection". If the documentation is not about to be generated, pre-generated docs will be installed if they are available. That is commonly the case with a source tarball, but not with a git checkout. Finally, if documentation is nither generated nor pre-generated, no documentation will be installed *duh*. This removes the possibility to treat man pages separate from settings docs. Now you either generate both, install both pre-generated, or don't get any of them. https://bugzilla.gnome.org/show_bug.cgi?id=778551
* build: move code around and reorder conditionsThomas Haller2017-02-132-28/+32
| | | | No changes really, except moving related stuff closer together.
* cli: make nmcli do its own command completionlr/completion-3Lubomir Rintel2017-02-131-1240/+57
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=777328
* cli: fix setting of private key passwordBeniamino Galvani2017-02-131-1/+2
| | | | | | | | | We can't pass the password obtained from nm_setting_802_1x_get_*private_key_password() to nm_setting_802_1x_set_*private_key() as the latter also frees the old password. Fixes: afd281102879168f13fb4d1deff9535542ad6fc5
* platform: avoid printing "(null)" interface name during loggingThomas Haller2017-02-101-3/+3
| | | | | | | | Avoids: platform: link: setting up '(null)' (11) Use nm_strquote_a() to quote the string if it is not NULL.
* shared: cleanup nm_strquote_a() and nm_sprintf_bufa()Thomas Haller2017-02-101-28/+25
| | | | | | | | - simplify nm_strquote_a(). - use '"' for quoting instad of '\''. - have nm_sprintf_bufa() evalute @n_elements only once.
* dns: fix shutdown to restore non-cached DNS configThomas Haller2017-02-103-15/+46
| | | | | | | | | | | | | | | | | | The DNS manager and other singletons have the problem that they are not properly destroyed on exit, that is, we leak most of the instances. That should be eventually fixed and all resources/memory should be released. Anyway, fix the shutdown procedure by adding an explict command nm_dns_manager_shutdown(). We should not rely on cleanup actions to take place when the last reference is dropped, because then we get complex interactions where we must ensure that everybody drops the references at the right pointer. Since the previous shutdown action was effectively never performed, it is not quite clear what we actually want to do on shutdown. For now, move the code to nm_dns_manager_stop(). We will see if that is the desired behavior.
* platform: use IFA_FLAGS name instead of numeric valueThomas Haller2017-02-101-1/+1
| | | | | Originally, IFA_FLAGS might not have been present in the headers. In the mean time, we explicitly define it outself to be "8".
* platform: unify logging messages about kernel supportThomas Haller2017-02-101-10/+8
| | | | Give them a common prefix.
* platform: downgrade warning about failure to detect kernel support to debugThomas Haller2017-02-101-2/+2
| | | | | | | | Also, as time goes by it is less likely to encounter a user where the kernel has no support. The most likely reason nowadays is that the user booted with "ipv6.disabled=1". https://bugzilla.redhat.com/show_bug.cgi?id=1421019
* all: merge branch 'th/device-pending-action-bgo777831' (part 3, connection-list)Thomas Haller2017-02-1012-302/+379
|\ | | | | | | | | | | | | Refactor core to return list of connections as array instead of GSList. Also unify and cleanup the sorting of connections. https://bugzilla.gnome.org/show_bug.cgi?id=777831
| * core: define a full sort order for nm_settings_connection_cmp_timestamp()Thomas Haller2017-02-102-32/+50
| | | | | | | | | | | | | | | | | | We want to have some guaranteed order when comparing different connections. So, in case of equal timestamps, proceed with comparing more properties. It makes sense to consider the autoconnect-priority next. This is what get_existing_connection() needs, thus we no longer need to pre-sort the list.
| * core: consolidate sorting of connections by autoconnect/timestampThomas Haller2017-02-108-57/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMPolicy's auto_activate_device() wants to sort by autoconnect-priority, nm_utils_cmp_connection_by_autoconnect_priority() but fallback to the default nm_settings_connection_cmp_default(), which includes the timestamp. Extend nm_settings_connection_cmp_default() to consider the autoconnect-priority as well. Thus change behavior so that nm_settings_connection_cmp_default() is the sort order that auto_activate_device() wants. That makes sense, as nm_settings_connection_cmp_default() already considered the ability to autoconnect as first. Hence, it should also honor the autoconnect priority. When doing that, rename nm_settings_connection_cmp_default() to nm_settings_connection_cmp_autoconnect_priority().
| * core: make nm_utils_cmp_connection_by_autoconnect_priority() more robustThomas Haller2017-02-101-13/+43
| | | | | | | | | | | | Check for NULL and unexpected missing NMSettingConnection. Be more forgiving and accept whatever is there when comparing @a with @b.
| * core: refactor nm_manager_get_activatable_connections() to return an arrayThomas Haller2017-02-103-36/+60
| | | | | | | | ... instead of a GSList.
| * core: refactor nm_settings_get_connections_sorted() to return array instead ↵Thomas Haller2017-02-105-85/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of GSList We call these functions a lot. A GSList is just the wrong tool for the job. Refactor the code to use instead a sorted array everywhere. This means, we malloc() one array for all connections instead slice-allocate a GSList item for each. Also, sorting an array is faster then sorting a GSList. Technically, the GSList implementation had the same big-O runtime complexity, but using an array is still faster. That is, sorting an array and a GSList is both O(n*log(n)). Actually, nm_settings_get_connections_sorted() used g_slist_insert_sorted() instead of g_slist_sort(). That results in O(n^2). That could have been fixed to have O(n*log(n)), but instead refactor the code to use an array.
| * core: drop nm_settings_get_best_connections() for new ↵Thomas Haller2017-02-105-112/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_settings_get_connections_clone() nm_settings_get_best_connections() has only one caller: to create the hidden-SSID list. Instead of having a highly specialised function (that accepts 3 ways for filtering -- one of them broken, has one hard-coded way of sorting, and a @max_requested argument), add a more generic nm_settings_get_connections_clone() function. Also invert nm_settings_sort_connections(). The two callers want to sort descending, not ascending.
| * core: add and use nm_settings_connection_cmp_default*()Thomas Haller2017-02-103-30/+35
| | | | | | | | Only move the function, no change in behavior.
| * core: add and use nm_settings_connection_cmp_timestamp*()Thomas Haller2017-02-105-34/+42
| | | | | | | | Only move the function, no change in behavior.
| * core: add nm_utils_cmp_connection_by_autoconnect_priority_p_with_data() functionThomas Haller2017-02-104-7/+17
|/ | | | | | | | | | Have a proper cmp() function and a wrapper *_p_with_data() that can be used for g_qsort_with_data(). Thus, establish a naming scheme (*_p_with_data()) for these compare wrappers that we need all over the place. Note, we also have nm_strcmp_p_with_data() for the same reason and later more such functions will follow.
* all: merge branch 'th/device-pending-action-bgo777831' (part 2, wifi-scan)Thomas Haller2017-02-1010-365/+414
|\ | | | | | | | | | | | | Delay startup complete until Wi-Fi device completed scan and autoactivation. https://bugzilla.gnome.org/show_bug.cgi?id=777831
| * device/wifi: prevent clearing pending wifi scan action during inactive ↵Thomas Haller2017-02-101-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | supplicant <debug> [1486325858.0691] device[0x563b8fba42e0] (wlp3s0): wifi-scan: scan-done callback: successful <debug> [1486325858.0692] device[0x563b8fba42e0] (wlp3s0): wifi-scan: scheduled in 23 seconds (interval now 33 seconds) <debug> [1486325858.0692] device[0x563b8fba42e0] (wlp3s0): remove_pending_action (0): 'wifi-scan' <trace> [1486325858.0692] properties-changed[0x563b8fba42e0]: ignoring notification for prop has-pending-action on type NMDeviceWifi <debug> [1486325858.0692] manager: check_if_startup_complete returns FALSE because of enp0s25 <info> [1486325858.0697] device (wlp3s0): supplicant interface state: ready -> inactive <debug> [1486325858.0698] device[0x563b8fba42e0] (wlp3s0): wifi-scan: scanning requested <debug> [1486325858.0698] device[0x563b8fba42e0] (wlp3s0): wifi-scan: (0) probe scanning SSID <hidden> <debug> [1486325858.0698] device[0x563b8fba42e0] (wlp3s0): wifi-scan: (1) probe scanning SSID "aaa" <trace> [1486325858.0699] device[0x563b8fba42e0] (wlp3s0): set-hw-addr: no MAC address change needed (2A:71:5D:54:85:1F) <debug> [1486325858.0699] device[0x563b8fba42e0] (wlp3s0): add_pending_action (1): 'wifi-scan'
| * device/wifi: don't emit wrong SCAN_DONE signal when "Scan" request completesThomas Haller2017-02-101-2/+0
| | | | | | | | | | | | | | | | | | scan_request_cb() handles the answer from the D-Bus "Scan" method. At that point, the scan is not yet done, it merely started. It is wrong to already signal SCAN_DONE. The only place where we want to signal SCAN_DONE is when we actually receive the "ScanDone" D-Bus signal.
| * device/wifi: first emit NEW_BSS signals before SCAN_DONEThomas Haller2017-02-101-2/+2
| | | | | | | | | | | | In the SCAN_DONE handler, NMDeviceWifi resets the flag that indicates that a current scan request is pending. We need to first obtain the new APs (NEW_BSS) before signalling SCAN_DONE.
| * device/wifi: don't reschedule idle handler for schedule_ap_list_dump()Thomas Haller2017-02-101-2/+2
| |
| * device/wifi: cache GObject property "scanning"Thomas Haller2017-02-102-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cache the value for accessing the GObject property NM_DEVICE_WIFI_SCANNING. Re-evaluating the property every time by checking the supplicant interface is ugly because it might change under the hood. It should only change if (and only if) we emit a notify changed signal. Also, avoid accessing nm_supplicant_interface_get_scanning (priv->sup_iface) without checking whether priv->sup_iface is not NULL.
| * device/wifi/trivial: reorder code in "nm-device-wifi.c"Thomas Haller2017-02-101-73/+74
| |
| * device/wifi: give wifi-scan related logging message common prefixThomas Haller2017-02-101-11/+11
| | | | | | | | | | Add a prefix "wifi-scan: " to related logging messages for easier searching the logfiles.
| * device/wifi: ensure consistent timestamp for dumping Wi-Fi APThomas Haller2017-02-103-11/+15
| | | | | | | | | | | | | | | | When we dump a list of APs, determine one timestamp for "now", instead of re-evaluating it every time. This ensures that all APs are printed with the same understanding of the current timestamp.
| * device/wifi: log scanning related messages with LOGD_WIFI instead of ↵Thomas Haller2017-02-101-26/+29
| | | | | | | | | | | | | | | | | | | | | | LOGD_WIFI_SCAN LOGD_WIFI_SCAN is there to avoid flodding the log with continous scan results. It should not be used for messages related to scheduling scan requests. This is especially important, because LOGD_WIFI_SCAN domain is not included in LOGD_DEFAULT.
| * device/wifi: refactor logging of Wi-Fi AP by preserving logging context of ↵Thomas Haller2017-02-103-39/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | device The _LOGD() macros of NMDeviceWifi print a logging context for each line, that is, they add a prefix with the device name. Replace nm_wifi_ap_dump() by nm_wifi_ap_to_string() and let device log a message about the AP. Also, update the format for printing the AP. Now, all fields are separated by space.
| * device: cleanup handling queued state change in NMDeviceThomas Haller2017-02-102-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | - no longer bother clearing .state and .reason when the .id field is unset. The fields just don't matter and no user accesses these fields when the glib source id is not set. - unify logging and give them all a prefix "queue-state[%s, %s, %u]: ". - drop nm_device_queued_state_peek(), it only had one caller, thus inline the trivial check. - make nm_device_queued_state_clear() a static function queued_state_clear() - rename queued_set_state() to queued_state_set().
| * device/trivial: reorder defines in "nm-device.c"Thomas Haller2017-02-101-58/+63
| | | | | | | | | | | | | | | | | | Reorder code to be like in other source files: - first includes and generic defines - then various helper structs - then GObject related declarations, with first signal and property enums, then the private data, then the G_DEFINE_TYPE() itself. - finally, forward declarations for functions.
| * device: change hw_addr_type field to bitfield typeThomas Haller2017-02-101-2/+5
| | | | | | | | | | | | | | We don't want to waste a full "int" size to store the @hw_addr_type in NMDevicePrivate. Previously, that was hacked around by using guint8. Now, instead use a bitfield which has the right type.
| * device: inline device helper structs QueuedState and PingInfoThomas Haller2017-02-101-18/+14
| | | | | | | | | | | | | | | | | | | | These two structs are only used at exactly one place: as the type for a field in NMDevicePrivate. Having additional structs (that are only used at one place) only add noise. Also, there are already prior-acts of using unnamed structs in NMDevicePrivate in case of structs that only serve to group/namespace a set of fields.
| * device: prepend pending actions listThomas Haller2017-02-101-1/+1
| | | | | | | | | | The order doesn't matter, so prepend instead of append new items to the pending-actions list.
| * device: don't clone pending-action stringThomas Haller2017-02-101-5/+6
| | | | | | | | | | | | All callers either use a static @action argument or keep a clone of the string that lives as long as the action is pending. So, save cloning the string.
| * device: implement queued_state_to_string() via ↵Thomas Haller2017-02-101-23/+16
| | | | | | | | NM_UTILS_LOOKUP_STR_DEFINE_STATIC()
| * device: refactor pending-action strings as named definesThomas Haller2017-02-106-48/+56
| |
| * device: queue recheck-available before removing "wait for supplicant" ↵Thomas Haller2017-02-101-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | pending action While we still recheck-available, we want to queue a pending action to block startup-complete. However, we have to queue that before removing the pending action for "wait for supplicant". <debug> [...] device[0x563abbcca400] (wlp2s0): remove_pending_action (0): 'waiting for supplicant' <info> [...] manager: startup complete <debug> [...] device[0x563abbcca400] (wlp2s0): add_pending_action (1): 'queued state change to disconnected'
| * device: add pending-action "recheck-available"Thomas Haller2017-02-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Startup-complete means that all devices have settled in a state and no further activation is pending. When we have a recheck-available scheduled, we clearly should not yet declare startup-complete. Add a new pending-action "recheck-available" to avoid: <info> [1485520408.3920] device (wlp2s0): supplicant interface state: starting -> ready <debug> [1485520408.3920] device[0x563abbcca400] (wlp2s0): remove_pending_action (0): 'waiting for supplicant' <info> [1485520408.3920] manager: startup complete <debug> [1485520408.3924] device[0x563abbcca400] (wlp2s0): add_pending_action (1): 'queued state change to disconnected'
| * core: use define for GObject property name NM_SUPPLICANT_INTERFACE_SCANNINGThomas Haller2017-02-101-1/+1
|/ | | | | | | grep-ing for '\<scanning\>' yields 42 hits under src. But only 2 are actual references to the "scanning" GObject property of NMDeviceWifi. Use a #define with a unique name where we mean NMDeviceWifi's property.
* all: merge branch 'th/device-pending-action-bgo777831' (part 1, cached-quark)Thomas Haller2017-02-1020-111/+112
|\ | | | | | | | | | | Add and use NM_CACHED_QUARK() macro. https://bugzilla.gnome.org/show_bug.cgi?id=777831
| * all: use NM_CACHED_QUARK_FCN() to define cached quarksThomas Haller2017-02-105-46/+14
| |
| * all: use NM_CACHED_QUARK_FCN() instead of G_DEFINE_QUARK()Thomas Haller2017-02-106-17/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think NM_CACHED_QUARK_FCN() is better because: - the implementation is in our hand, meaning it is clear that putting a "static" before NM_CACHED_QUARK_FCN() is guaranteed to work -- without relying on G_DEFINE_QUARK() to be defined in a way that this works (in fact, we currently never do that and instead make all functions non-static). - it does not construct function names by appending "_quark". Thus you can grep for the entire function name and finding the place where it is implemented. - same with the stings, where the new macro doesn't stringify the argument, which is less surpising. Again, now you can grep for the string including the double quoting. (yes, I really use grep to understand the source-code)
| * core: use cached GQuark and g_object_[gs]et_qdata()Thomas Haller2017-02-109-48/+50
| | | | | | | | | | Use g_object_[gs]et_qdata() instead of g_object_[gs]et_data() with a cached quark. This saves an additional lookup to intern the string.