summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core: use the new safe macro to avoid clashing with libjson-glib.fg/json_symbol_clashFrancesco Giudici2017-12-231-2/+2
|
* libnm-core: export a wrapper of json_object_iter_next () functionFrancesco Giudici2017-12-231-0/+76
| | | | | | | | | | | This is required in order to overcome the clash of the symbol in shared libraries libjansson and libjson-glib: this happens in gnome-control-center, which loads the libjson-glib shared library and the libnm one, which has libjansson as a dependency. Declare also the macro 'nm_json_object_foreach' and 'nm_json_object_foreach_safe' which are basically a clone of the 'json_object_foreach' and 'json_object_foreach_safe' ones, but drop the clashing symbol in favor of the new wrapper.
* shared/compat: minor refactoring of compat codeThomas Haller2017-12-221-7/+7
| | | | | Don't cache the entire GPtrArray, just the plain strv. Also, use parentheses for sizeof().
* shared/compat: Fix memory handling of nm_setting_vpn_get_*_keys (v2)Jan Alexander Steffens (heftig)2017-12-221-5/+12
| | | | | | | | | | | | | | | The compat implementations return a (transfer none) strv instead of a (transfer container) one. This has caused double frees in nm-applet: https://bugs.archlinux.org/task/56772 We still need to copy the keys because nm_setting_vpn_foreach_* provides us with copies that are freed after the iteration. Fix this by handing out a duplicate of the array. Fixes: 272439cb2077a889485dd195bb6b99ca91d3e3bf https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00070.html
* Revert "shared/compat: fix memory handling of nm_setting_vpn_get_*_keys"Jan Alexander Steffens (heftig)2017-12-221-1/+9
| | | | | | | | | | This reverts commit 8ac8c01162235c2c198bfaf25fb7d1a57a595ce5. The fix was bad because the keys do not come from NMSettingVpn's hash table but are copies that are freed by nm_setting_vpn_foreach_* before it returns. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00069.html
* wifi/iwd: merge branch 'pr/42'Thomas Haller2017-12-213-31/+295
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/42
| * iwd: fix coding style to use curly braces for multi-line if()Thomas Haller2017-12-211-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our convention is that when the body of an if() or for() spawns more then one line, then it needs curly braces. If it's only one line, it should have no curly braces. The latter part seems sometimes a bit inconvenient, because changing if (some_condition) do_something (); gets change to if (some_condition) { do_something (); do_something_else (); } the diff shows 3 lines changed, although really only one changed. But well, that's how it is...
| * iwd: For 8021x networks verify they're IWD Known NetworksAndrew Zaborowski2017-12-211-9/+42
| | | | | | | | | | | | | | | | | | | | Verify that an 8021x network is preprovisioned on IWD side before declaring a connection as "available" or "compatible". Also move the Infrastrucure mode check and the Hidden SSID check in check_connection_available earlier because even if a compatible AP is available and the connection can be used with wpa_supplicant, it can't be used with IWD at this time.
| * iwd: Don't require secrets for IWD Known NetworksAndrew Zaborowski2017-12-211-2/+46
| | | | | | | | | | | | | | | | | | | | This is mainly to enable using 8021x networks, which have to be preprovisioned as an IWD config file to be supported and can not be configured by asking the user for secrets over DBus, this is an IWD's design choice. Note that this assumes that secrets are only used during the Stage 2 of the activation, i.e. for the wifi handshake, not in the later stages.
| * iwd: Track IWD Known NetworksAndrew Zaborowski2017-12-213-17/+203
| | | | | | | | | | | | | | Keep a list of IWD's Known Networks which are networks that have their configurations stored by IWD including the secrets, either because they have been connected to before or because they were preprovisioned on the machine.
| * iwd: Remove a stray return and a newlineAndrew Zaborowski2017-12-211-3/+0
|/
* ifnet: merge branch 'th/setting-plugin-ifnet'Thomas Haller2017-12-2133-7850/+22
|\ | | | | | | | | | | | | Drop the "ifnet" settings plugin that was used on Gentoo. It's unmaintained and unused for a long time. https://github.com/NetworkManager/NetworkManager/pull/43
| * settings: drop unmaintained ifnet settings plugin of GentooThomas Haller2017-12-2132-7835/+8
| | | | | | | | | | | | | | | | | | | | | | | | Even Gentoo disables this plugin since before 0.9.8 release of NetworkManager. Time to say goodbye. If somebody happens to show up to maintain it, we may resurrect it later. If "$distro_plugins=ifnet" was set, configure.ac would use that to autodetect --with-hostname-persist=gentoo. Replace that autodetect part by checking for /etc/gentoo-release file.
| * build: drop --enable-ifcfg-suse configure optionThomas Haller2017-12-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | The option is deprecated together with the ifcfg-suse settings plugin. Selecting the plugin has no effect at runtime, beside logging a warning. Drop the configure option. Note, that if $distro_plugins was set to "ifcfg-suse", it was also used to autodetect --with-hostname-persist=suse. Now, autodetect the hostname persist mode based on presence of /etc/SuSE-release file.
| * build/meson: drop option for deprecated ifcfg-suse setting pluginsThomas Haller2017-12-212-6/+0
| |
| * man: document all setting plugins in NetworkManager.conf manualThomas Haller2017-12-212-14/+24
|/ | | | although they are deprecated and unused, document them.
* all: add more meaningful error code for unsupported IP methodBeniamino Galvani2017-12-214-4/+7
| | | | | | | | | | | | | | | | | | | | | | Add a new device state reason code for unsupported IP method. It is returned, for example, when users select manual IP configuration for WWAN connections: # nmcli connection mod Gsm ipv4.method manual ipv4.address 1.2.3.4/32 # nmcli connection up Gsm Error: Connection activation failed: The selected IP method is not supported compared to the old: Error: Connection activation failed: IP configuration could not be reserved (no available address, timeout, etc.) Note that we could instead fail the connection validation if the method is not supported by the connection type, but adding such limitation now could make existing connections invalid. https://bugzilla.redhat.com/show_bug.cgi?id=1459529
* libnm: reuse nm_utils_strdict_get_keys() to implement NMSettingVpn's get_keys()Thomas Haller2017-12-211-35/+6
|
* shared/compat: fix memory handling of nm_setting_vpn_get_*_keysJan Alexander Steffens (heftig)2017-12-211-9/+1
| | | | | | | | | | | | The compat implementations return a (transfer none) strv instead of a (transfer container) one. This has caused double frees in nm-applet: https://bugs.archlinux.org/task/56772 Don't copy the keys and don't free the container later. [thaller@redhat.com: patch adjusted to avoid compiler warning] Fixes: 272439cb2077a889485dd195bb6b99ca91d3e3bf
* wwan: merge branch 'bg/modem-default-route-rh1527934'Beniamino Galvani2017-12-211-26/+26
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1527934
| * wwan: clear idle source id when the callback runsBeniamino Galvani2017-12-211-0/+3
| | | | | | | | Fixes: f0996d0eb82254ea794cf9607e4a9b4e2dc3d029
| * wwan: add default route even if modem didn't return a gatewayBeniamino Galvani2017-12-211-19/+15
| | | | | | | | | | | | If the modem didn't return a gateway, add a device route. Fixes: 5c299454b49b165f645c25fd3e083c0bb747ad91
| * wwan: fix checks on IP configurationBeniamino Galvani2017-12-211-7/+8
|/ | | | | | | | | Don't call nm_utils_parse_inaddr_bin() if the string returned by mm_bearer_ip_config_get_address() and mm_bearer_ip_config_get_gateway() is NULL, as the function requires a valid pointer. Throw an error if the address is NULL, but allow an empty gateway. Fixes: 7837afe87f0f269c0cc4de1c9c217529d760e83b
* settings: clear unsaved flag on new settings-connectionBeniamino Galvani2017-12-209-7/+11
| | | | | | | | | | | | | | When a new settings-connection is populated with the actual settings read from disk by the plugin, calling nm_settings_connection_update() with KEEP mode also marks it as unsaved, which should not happen on a new connection just written to (or read from) disk. Introduce a new KEEP_SAVED persist mode that is similar to KEEP but clears the UNSAVED flag. Fixes: 023ce50d2188af557b4f2af39ec5a3342612aa2f https://bugzilla.redhat.com/show_bug.cgi?id=1525078
* core: persist aspired default route-metric in device's state fileThomas Haller2017-12-204-41/+66
| | | | | | | | | | | | | | | | NMManager tries to assign unique route-metrics in an increasing manner so that the device which activates first keeps to have the best routes. This information is also persisted in the device's state file, however we not only need to persist the effective route-metric which was eventually chosen by NMManager, but also the aspired metric. The reason is that when a metric is chosen for a device, the entire range between aspired and effective route-metric is reserved for that device. We must remember the entire range so that after restart the entire range is still considered to be in use. Fixes: 6a32c64d8fb2a9c1cfb78ab7e2f0bb3a269c81d7
* settings: drop unused define for HOSTNAME_FILEThomas Haller2017-12-201-15/+0
| | | | Fixes: 5bfb7c3c89afe4da5b1ac2395391e9a986c722f0
* settings: avoid assertion when deleting connectionsBeniamino Galvani2017-12-206-13/+26
| | | | | | | | | | | | | | | | | | | | | | | If a volatile connection is deleted by user when it was already being deleted internally because the device vanished, we may hit the following failed assertion: file src/settings/nm-settings-connection.c: line 2196 (nm_settings_connection_signal_remove): should not be reached The @removed flag keeps track of whether we already signaled the connection removal. Instead of throwing an assertion if we try to emit the signal again, just return without action because this can happen in the situation described above. While at it, remove the @allow_reuse argument from nm_settings_connection_signal_remove(): we should never emit the signal twice. Instead, we should reset the @removed flag when the connection is added. Fixes: a9384452ed61ca3f1c6e1db175f499307da9c388 https://bugzilla.redhat.com/show_bug.cgi?id=1506552
* core: ensure that the default route-metric bumps at most 50 pointsThomas Haller2017-12-191-8/+18
| | | | | | | | | | | | | | First check that the limit of 50 metric points is not surpassed. Otherwise, if you have an ethernet device (aspired 100, effective 130) and a MACSec devic (aspired 125, effective 155), activating a new ethernet device would bump it's metric to 155 -- more then the 50 points limit. It doesn't matter too much, because the cases where the limit of 50 could have been surpassed were very specific. Still, change it to ensure that the limit is always honored as one would expect. Fixes: 6a32c64d8fb2a9c1cfb78ab7e2f0bb3a269c81d7
* man/openvswitch: fix type in examplesLubomir Rintel2017-12-191-10/+10
| | | | | | "conn.type" doesn't allow type aliases. Use "type" instead. https://bugzilla.redhat.com/show_bug.cgi?id=1519173
* build: Enable unused-but-set warning in mesonIñigo Martínez2017-12-181-1/+0
| | | | | | | | The unused-but-set warning has recently been enabled in autotools (e912b36d95a3c26a6021eeb27e663bd05910a9b4), so this also modifies meson to enable it. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00063.html
* build: Move default path values to options fileIñigo Martínez2017-12-183-166/+91
| | | | | | | | | | | | | Since meson 0.44 there is a new option type called `array`, which allows to use an array with different values in those options. These fits the needs of different options that are used to pass binary paths, which have multiple paths as an alternate locations. meson's version has been bumped to 0.44 and different options have been changed to `array` type options. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00062.html
* build: Remove documentation generation workaroundsIñigo Martínez2017-12-184-10/+3
| | | | | | | | | Documentation was not working in meson due to problems with files generated in `libnm`. To avoid these problems, workarounds were used. This problems have been recently fixed so these workarounds are not necessary anymore. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00061.html
* build: Drop HAVE_VLAN_FLAG_LOOSE_BINDINGIñigo Martínez2017-12-183-40/+0
| | | | | | | | Both meson and autotools define HAVE_VLAN_FLAG_LOOSE_BINDING to 1 or 0 depending if a small code snippet is compiled. However, this define is not used anymore. https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00060.html
* dns: rework write_to_netconfig()Thomas Haller2017-12-181-31/+38
| | | | | | | | | | The compiler warns when we ignore the return value from write(). And assigning it to an unused variable, causes another warning. Make some use of it, at least to handle EINTR. All other errors are still ignored. While at it, rework the write code to first write to a buffer in memory.
* core: avoid compiler warnings in write_to_netconfig() and ↵Thomas Haller2017-12-182-6/+4
| | | | | | | | | | | | | | | | | | ifnet_update_parsers_by_connection() src/dns/nm-dns-manager.c: In function ‘write_to_netconfig’: src/dns/nm-dns-manager.c:387:8: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result] write (fd, str, strlen (str)); ^ src/settings/plugins/ifnet/nms-ifnet-connection-parser.c: In function ‘ifnet_update_parsers_by_connection’: src/settings/plugins/ifnet/nms-ifnet-connection-parser.c:2600:26: error: variable ‘pppoe’ set but not used [-Werror=unused-but-set-variable] gboolean wired = FALSE, pppoe = TRUE; ^~~~~ While at it, don't log line breaks in ifnet_update_parsers_by_connection(). Fixes: e912b36d95a3c26a6021eeb27e663bd05910a9b4
* clients/cli: use a nicer password promptLubomir Rintel2017-12-183-12/+46
| | | | | | | | | | Makes sense in order for the user to know that they're actually typing the password (edited just to illustrate the point, the actual output was shamefully messy and perhaps needs fixing too): $ nmcli c up Wrathmosphere Passwords or encryption keys are required to access the wireless network 'Wrathmosphere'. Password (802-1x.password): *********
* libnm-core: move detection of UTF-8 capable terminals to clients/Lubomir Rintel2017-12-185-45/+73
| | | | | | | | Having it in libnm doesn't make any sense and prevents using it for more internal functionality. Too bad nm_utils_wifi_strength_bars() is already a public API. No problem -- replace it with a compatible yet dumber equivalent.
* clients/cli: don't store a password in historyLubomir Rintel2017-12-181-0/+5
| | | | | | | | History is probably even not useful at all outside the interactive edit mode, but that is another story. This just avoids awkward surprises, such as: https://bugzilla.gnome.org/show_bug.cgi?id=791200
* build: enable unused-but-set warningLubomir Rintel2017-12-181-1/+0
| | | | | It was disabled for shady reasons (not checking write() return value) that are long gone. Worse even, it hid some real bugs.
* all: get rid of a handful of unused-but-set variablesLubomir Rintel2017-12-1835-144/+39
|
* ifcfg-rh: remove the watch on finalizeLubomir Rintel2017-12-181-6/+7
|
* libnm/vpn: fix secret comparisonLubomir Rintel2017-12-182-12/+34
| | | | | One setting may contain a superset or subset of the another. Be sure not to ignore the presence of extra secret properties.
* manager: fix connectivity-check-enabled propertyLubomir Rintel2017-12-181-1/+1
|
* libnm-core/tc-config: remove deprecation guards from typedefsLubomir Rintel2017-12-181-3/+0
| | | | | They're triggered by the prototypes in header file inclusion, even though no routines or variables that use the type are actually used.
* build: fix out-of-tree build for generate-plugin-docs.plThomas Haller2017-12-181-3/+3
| | | | | | Fixes: 28914f6a68888d42cd6e7f3dd906df47199e9b39 https://bugzilla.gnome.org/show_bug.cgi?id=791731
* libnm: merge branch 'th/libnm-attribute-handling'Thomas Haller2017-12-1814-119/+138
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/39
| * libnm: add NM_IP_ADDRESS_ATTRIBUTE_LABEL defineThomas Haller2017-12-188-34/+36
| | | | | | | | | | There is only one supported attribute for addresses. The "lable". Give it a #define.
| * keyfile: avoid heap allocating temporay name for numbered key in ↵Thomas Haller2017-12-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | ip_address_or_route_parser() Odd, we iterate over a thousand names, without aborting when the first key isn't present. On the other hand, it means we cannot parse more then 1000 routes either :( Anyway, don't heap allocate the temporay string for the key name.
| * libnm: avoid deep cloning list of address attribute names for ↵Thomas Haller2017-12-183-10/+19
| | | | | | | | | | | | | | nm_utils_ip_addresses_to_variant() It's only a temporary list. No need for cloning the names as well.
| * libnm: sort attribute names in nm_tc_action_get_attribute_names()Thomas Haller2017-12-182-23/+13
| | | | | | | | | | The order in which the attribute names are returns should be defined and stable. Sort them and re-use the helper functions.