summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* keyfile: assert that write_array_of_uint() writes valid integer listth/keyfile-parsing-bgo776484Thomas Haller2017-01-042-10/+21
| | | | | | | | | | | | | | | | We use write_array_of_uint() for G_TYPE_ARRAY. In practice, only NMSettingDcb has any properties of this type. Furthermore, all valid values are either gboolean or guints of restricted range. Thus, no valid NMSettingDcb should violate the range check. Same for reader. It's really ugly to blindly use uint-list reader for G_TYPE_ARRAY. Especially, because certain G_TYPE_ARRAY properties of NMSettingDcb are actually arrays of gboolean, which only ~accidentally~ has the same memory layout as guint.
* keyfile: use nm_keyfile_plugin_kf_set_integer_list_uint8() helperThomas Haller2017-01-041-29/+10
|
* keyfile: add nm_keyfile_plugin_kf_set_integer_list_uint8() helperThomas Haller2017-01-042-0/+30
|
* keyfile: refactor parsing in get_bytes() to replace regexThomas Haller2017-01-041-57/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer use a regex to pre-evaluate whether @tmp_string looks like a integer list. Instead, parse the integer list ourself. First, drop the nm_keyfile_plugin_kf_has_key() check. Note that this merely verifies that such a key exits. It's rather pointless, because get_bytes() is only called for existing keys. Still, in case the check would actually yield differing results from the following nm_keyfile_plugin_kf_get_string(), we want to act depending on what nm_keyfile_plugin_kf_get_string() returns. Note that nm_keyfile_plugin_kf_get_string() looks up the key, alternatively fallback to the settings alias. Then, GKeyFile would parse the raw keyfile value and return it as string. Previously, we would first decide whether @tmp_string look like a integer list to decide wether to parse it via nm_keyfile_plugin_kf_get_integer_list(). But note that it's not clear that nm_keyfile_plugin_kf_get_integer_list() operates on the same string as nm_keyfile_plugin_kf_get_string(). Could it decide to return different strings based on whether such a key exists? E.g. when setting "802-11-wireless.ssid=foo" and "wifi.ssid=60;" they clearly would yield differing results: "foo" vs. [60]. Ok, probably it is not an issue because we call first nm_keyfile_plugin_kf_get_string(), decide whether it looks like a integer list, and return "foo" right away. This is still confusing and relyies on knowledge about how the value is encoded as string-list. Likewise, could our regex determine that the value looks like a integer list but then the integer list is unable to parse it? Certainly that can happen for values larger then 255. Just make it consistent. Get *one* @tmp_string. Try (manually) to interpret it as string list, or bail using it as plain text. Also, allow returning empty GBytes arrays. If somebody specifies an empty list, it's empty. Not NULL.
* shared: move nm_utils_strbuf_*() helper to shared/nm-utilsThomas Haller2017-01-044-94/+98
|
* keyfile/tests: add test for reading dcb connectionThomas Haller2017-01-043-0/+44
| | | | Catches previously fixed memleak in read_array_of_uint()
* keyfile: fix memleak in keyfile reader's read_array_of_uint()Thomas Haller2017-01-041-1/+1
| | | | Fixes: 9559a7a26021efa7ef49681b93a3b3bd4eadcef6
* device: merge branch 'th/device-parent-bgo776719'Thomas Haller2017-01-0421-476/+536
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=776719
| * device: drop unused hook nm_device_notify_new_device_added()Thomas Haller2017-01-043-31/+0
| | | | | | | | | | | | The only implementations were there for tracking the parent device. That is now donw via nm_device_parent_*(), parent_changed_notify() and _parent_notify_changed().
| * device: move tracking of peer device from NMDeviceVeth to NMDeviceThomas Haller2017-01-041-48/+28
| |
| * device: move tracking of parent device from NMDeviceVxlan to NMDeviceThomas Haller2017-01-042-47/+19
| |
| * device: move tracking of parent device from NMDeviceVlan to NMDeviceThomas Haller2017-01-042-96/+65
| |
| * device: move tracking of parent device from NMDeviceMacvlan to NMDeviceThomas Haller2017-01-043-93/+49
| |
| * device: move tracking of parent device from NMDeviceIPTunnel to NMDeviceThomas Haller2017-01-043-34/+9
| |
| * device: track parent device in NMDeviceThomas Haller2017-01-043-0/+202
| | | | | | | | | | | | | | Multiple subclasses have a parent/link interface (NMDeviceIPTunnel, NMDeviceVlan). Tracking the parent interface properly is midly complicated to get right. So, instead of repeating it in each subclass, track it in the parent device.
| * device: only emit notify::ifindex when the value actually changesThomas Haller2017-01-041-2/+4
| |
| * device: cleanup setting of ip-ifaceThomas Haller2017-01-041-36/+70
| | | | | | | | | | | | | | | | | | | | Move the updating/setting of the ip-ifindex/ip-iface to one place. Properties should be for the most part immutable/read-only, and only at particular places modified. That way, it's easier to track who changes a property. Also, add a logging line with "ip-ifname" prefix.
| * platform: use wrappers for if_nametoindex() and if_indextoname()Thomas Haller2017-01-042-8/+5
| |
| * platform: add wrappers for if_nametoindex() and if_indextoname()Thomas Haller2017-01-044-0/+44
| |
| * device: mark _nm_device_log_self_to_device() as unusedThomas Haller2017-01-041-1/+1
| |
| * trivial: rename reload_tun_properties() to update_properties()Thomas Haller2017-01-041-2/+2
| | | | | | | | That is what the function is called in other device implementations.
| * device: have realize_start_notify() call link_changed()Thomas Haller2017-01-048-60/+10
| | | | | | | | | | | | | | | | | | Most implementations of realize_start_notify() do the same for link_changed(). Let NMDevice's base implementation of realize_start_notify() call link_changed() -- which by default does notthing. This allows subclasses to only overwrite link_changed().
| * device/ethernet: refactor loading s390 subchannels during realizeThomas Haller2017-01-041-14/+12
| | | | | | | | | | | | Instead of overwriting constructed(), update the s390 subchannels via realize_start_notify(). This makes more sense and is also more similar to what other device implementations do.
| * device/vlan: update vlan properties when link changesThomas Haller2017-01-041-2/+11
| | | | | | | | | | For example, when the parent link is moved to a different netns, we must update (clear) the vlan's parent.
| * device: do nothing in NMDevice's link_changed() functionThomas Haller2017-01-042-8/+9
| | | | | | | | | | | | | | All implementations of link_changed() chain up to NMDevice's base implementation. Thus, everybody wants to set the carrier. Refactor the code to set the carrier outside of link_changed().
| * device: make @pllink argument in link_changed() function constThomas Haller2017-01-047-18/+20
|/
* wifi: merge refactor tracking of APsThomas Haller2017-01-044-78/+110
|\
| * wifi: fix nm_wifi_ap_get_id() to parse the ID as guint64 from the exported pathThomas Haller2017-01-043-6/+16
| |
| * wifi: implement NM_DEVICE_WIFI_ACCESS_POINTS property getter via ↵Thomas Haller2017-01-041-11/+8
| | | | | | | | | | | | | | ap_list_get_sorted_paths() That way, we get the list sorted. Also, it saves several allocations of temporary variables.
| * wifi: refactor getting sorted AP listThomas Haller2017-01-041-42/+68
| | | | | | | | | | | | Instead of creating a GSList use an array. That way, we save the allocation and free of an GSList instance. Also, avoid cloning the export path. It is stable.
| * dns: fix memleak in _get_config_variant()Thomas Haller2017-01-041-21/+20
|/ | | | | | | There are cases where we wouldn't call g_variant_builder_end() on @strv_builder and @entry_builder. Fixes: e3c67177ac7234923f53c51473f77df8a2cb0f20
* libnm/docs: merge fix for generating API documentation fro enums (bgo#776848)Thomas Haller2017-01-043-186/+189
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=776848
| * libnm: explicitly set enum values in public nm-dbus-interface.h headersThomas Haller2017-01-042-184/+184
| | | | | | | | | | | | Previously, due to a bug in "tools/enums-to-docbook.pl", enum values without explicit numeric value were wrongly parsed. That is fixed, but still explicitly set the value in the public header.
| * docs: fix handling enums without explicit numeric value in ↵Thomas Haller2017-01-041-2/+5
|/ | | | | | | | | | | | | | | | | "tools/enums-to-docbook.pl" Previously, an enum that didn't explicitly specify a numeric value would wrongly start counting at 1. E.g. typedef enum { MY_VAL, } Name; would result in documentation with MY_VAL=1. https://bugzilla.gnome.org/show_bug.cgi?id=776848
* nm-online: obtain NMClient asynchronouslyLubomir Rintel2017-01-041-90/+82
| | | | | | | | | | | | | | | | Before: $ time nm-online real 0m0.438s user 0m0.192s sys 0m0.023s After: $ time ./clients/nm-online real 0m0.096s user 0m0.060s sys 0m0.010s
* exported-object: merge extending counter for D-Bus paths to 64bitThomas Haller2017-01-0312-16/+20
|\
| * exported-object: don't use "/0" for D-Bus paths but start with 1Thomas Haller2017-01-031-1/+1
| | | | | | | | | | | | Only use non-negative index values for the D-Bus path. This is purely cosmetical, as the actual path value should be treated as opaque. Still, avoid using 0 and start counting at 1.
| * exported-object: don't clone class_export_path for counter cacheThomas Haller2017-01-031-1/+1
| | | | | | | | It's a static string anyway.
| * exported-object: make export_path D-Bus counter 64 bitThomas Haller2017-01-032-6/+8
| | | | | | | | | | | | An overflow of the 32 bit guint is possible and rather ugly because the D-Bus path should be unique and not repeat. Avoid that by extending the counter to 64 bit.
| * exported-object: use NM_EXPORT_PATH_NUMBERED() macroThomas Haller2017-01-0310-10/+10
| |
| * exported-object: add NM_EXPORT_PATH_NUMBERED() macroThomas Haller2017-01-031-0/+2
|/
* ifcfg-rh: merge branch 'th/ifcfg-shvar-line-bgo776467'Thomas Haller2017-01-022-221/+275
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=776467
| * ifcfg-rh: refactor svOpenFile() to use nm_utils_fd_get_contents()Thomas Haller2017-01-021-68/+62
| | | | | | | | | | | | | | | | | | | | Use nm_utils_fd_get_contents() which has precisely all the steps implemented to read data from a file descriptor. There is a downside to this: previously you could compile shvar.c without nm-core-utils.c. Now, the ifcfg implementation gained a dependency on NM core utils. That would matter if we one day would like to build shvar.c without core NetworkManager utils (but that is not planned).
| * ifcfg-rh: add assertions for handling lines in "shvar.c"Thomas Haller2017-01-021-0/+47
| | | | | | | | Just assert that the shvarLine instances are in a valid state.
| * ifcfg-rh: refactor handling of lines in shvar.cThomas Haller2017-01-021-115/+126
| | | | | | | | | | | | | | | | Pre-process each line and parse the key and value. Thus, keep the key already prepared. The point is to do the parsing early and keep the data in a more suitable format in shvarLine.
| * ifcfg-rh: refactor searching and replacing shvarLine in svhar.cThomas Haller2017-01-011-86/+76
| | | | | | | | | | | | | | | | | | The shlist_delete*() are now named wrong, as they don't delete the list entry. Anyway, they have only one caller, it's clearer to inline them. This way, during svSetValue() we need to iterate the entire list only once.
| * shared: add nm_str_skip_leading_spaces() macroThomas Haller2016-12-251-0/+12
|/
* manager: better handle failures in AddAndActivateConnectionBeniamino Galvani2016-12-231-1/+2
| | | | | | nm_settings_add_connection_dbus() invokes the activation_add_done() callback with a NULL @new_connection in case of error: add a check to prevent a crash.
* policy: don't apply DNS configuration for non-active devicesBeniamino Galvani2016-12-211-1/+1
| | | | | | | | Don't apply DNS configuration of non-active devices (for example unmanaged ones which have a non-empty DNS configuration read from a DHCP lease). https://bugzilla.redhat.com/show_bug.cgi?id=1405431
* wifi: don't request new PSK for locally-generated ↵Dan Williams2016-12-201-1/+11
| | | | | | | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY errors This usually indicates that the driver missed beacons from the AP, due to driver bugs or faulty power-save management. It doesn't mean that the PSK is wrong.