summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cli: don't force interface name on add_and_activatelr/cli-ifname-add-and-activateLubomir Rintel2019-05-071-1/+0
| | | | | | | The daemon is already responsible for pinning the connection to a particular device. In fact, it may choose to use a different means than an interface name, such as a MAC address or a gsm.device-id. Remove it from the client.
* device: fix reapply of MTUBeniamino Galvani2019-05-061-0/+3
| | | | | | | | | | | | | | | | | When we set the MTU on the link we remember its previous source (ip-config, parent-device or connection profile) and don't change it again afterwards to avoid interfering with user's manual changes. The only exceptions when we change it again are (1) if the parent device MTU changes and (2) if the new MTU has higher priority than the one previously set. To allow a live reapply of the MTU property we also need to clear the saved source, or the checks described above will prevent setting the new value. Fixes: 2f8917237fdf ('device: rework mtu priority handling') https://bugzilla.redhat.com/show_bug.cgi?id=1702657
* cli: merge branch 'bg/rh1702199'Beniamino Galvani2019-05-065-26/+65
|\ | | | | | | | | | | | | | | Don't print blob certificates unless the '--show-secrets' option is passed to nmcli; plus other related changes. https://bugzilla.redhat.com/show_bug.cgi?id=1702199 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/122
| * cli: hide certificate blobs unless --show-secrets is passedBeniamino Galvani2019-05-061-2/+1
| | | | | | | | | | | | This restores the behavior before commit 99711579ed43. Fixes: 99711579ed43 ('cli: add property type for 802-1x certificate properties (pt2)').
| * cli: complete 802.1x certificate file namesBeniamino Galvani2019-05-061-0/+21
| |
| * cli: allow completing filenamesBeniamino Galvani2019-05-065-8/+24
| | | | | | | | | | Allow the completion function to indicate that the word should be completed as a filename by the shell.
| * cli: remove bluetooth completion codeBeniamino Galvani2019-05-061-8/+2
| | | | | | | | | | | | | | The 'bt-type' property alias accepts values provided by gen_func_bt_type(); instead the 'bluetooth.type' property can only be set to [dun, panu, nap] and therefore it doesn't need special handling.
| * cli: parse escape sequences when reading an 802.1x private keyBeniamino Galvani2019-05-061-10/+18
| | | | | | | | | | In this way it become possible to specify a filename that includes one of the delimiters.
| * cli: fix setting private key passwordBeniamino Galvani2019-05-061-0/+1
|/ | | | Fixes: fe390556abfe ('cli: add property type for 802-1x certificate properties (pt3)')
* settings: fix failed assertionBeniamino Galvani2019-05-061-1/+1
| | | | | | | | | | Fix the following assertion failure: g_object_ref: assertion 'G_IS_OBJECT (object)' failed. nm_settings_add_connection() can return a NULL connection. Fixes: f034f17ff69c ('settings: keep the added connection alive for a bit longer')
* po: update Spanish (es) translationRodrigo Lledó2019-05-041-2399/+2987
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/135
* release: bump version to 1.19.2-dev1.19.2-devLubomir Rintel2019-05-032-2/+2
|
* build: fix an out-of-tree buildLubomir Rintel2019-05-031-1/+1
| | | | | | | | | | | make[3]: Entering directory 'NetworkManager/_build/sub' CC clients/cli/nmcli-common.o cc1: error: ./clients/common: No such file or directory [-Werror=missing-include-dirs] cc1: all warnings being treated as errors The only generated header in $builddir/clients/common is settings-docs.h and only libnmc.la needs it. Include the directory on the command line only when we know it exists.
* NEWS: updateLubomir Rintel2019-05-031-0/+2
|
* device/wireguard: fix memleak for NMDeviceWireGuardThomas Haller2019-05-031-0/+2
| | | | Fixes: 2148d0948202 ('core/wireguard: add support for WireGuard peers')
* platform/tests: workaround routing-rules test failure due to ↵Thomas Haller2019-05-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | suppress_prefixlen on older kernels On Ubuntu 14.04 kernel (4.4.0-146-generic, x86_64) this easily causes test failures: make -j 8 src/platform/tests/test-route-linux \ && while true; do \ NMTST_SEED_RANDOM= ./tools/run-nm-test.sh src/platform/tests/test-route-linux -p /route/rule \ || break; \ done outputs: ... /route/rule/1: nmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=22892021 OK /route/rule/2: >>> failing... >>> no fuzzy match between: [routing-rule,0x205ab30,1,+alive,+visible; [6] 0: from all suppress_prefixlen 8 none] >>> and: [routing-rule,0x205c0c0,1,+alive,+visible; [6] 0: from all suppress_prefixlen -1579099242 none] ** test:ERROR:src/platform/tests/test-route.c:1695:test_rule: code should not be reached
* po: update Spanish (es) translationRodrigo Lledó2019-05-011-32/+30
| | | | | | | | | Changing "Token" translation from "identificador" to "testigo" as discussed in the GNOME Spanish Translation Team's mailing list. Special thanks to Daniel Mustieles our coordinator. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/130
* po: update Ukrainian (uk) translationYuri Chornoivan2019-05-011-2518/+2618
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/128
* libnm: merge branch 'th/libnm-setting-cleanup'Thomas Haller2019-05-0125-385/+555
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/126
| * libnm: unify property-to-dbus handling of NMSettingThomas Haller2019-05-0111-135/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge the function pointer get_func() into to_dbus_fcn(). Previously, get_func() as handled separately from to_dbus_fnc() (formerly synth_func()). The notion was that synth-func would syntetize properties that are D-Bus only. But that distinction does not seem very helpful to me. Instaed, we want to convert a property to D-Bus. Period. The implementation should be handled uniformly. Hence, now that is all done by property_to_dbus(). Note that property_to_dbus() is also called as default implementation for compare-property. At least, for properties that are backed by a GObject property.
| * libnm: rename function pointers of NMSettInfoPropertyThomas Haller2019-05-014-87/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The naming was not very clear. How does get_func(), synth_func() and to_dbus() relate? What does synth_func() do anyway? Answers: - get_func() and synth_func() do very similar. They should be merged in a next step. synth_func() has the notion of "synthetize" a property for D-Bus. As such, these properties are a bit unusual in that they don't have a backing GObject property in the setting. But it'd rather treat such properties like other properties. The step in that direction will be to merge the to-dbus functions. - to_dbus() converts a GValue of the GObject property go GVariant. It's a simplified form of get_func()/synth_func() and a better name is gprop_to_dbus_fcn(). The same for gprop_from_dbus_fcn(). For now, just rename.
| * libnm: pass connection to compare_property() functionThomas Haller2019-05-0118-129/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have certain artificial properties that not only depend on one property alone or that depend on a property in another(!) setting. For that, we have synth_func. Other than that, synth_func and get_func are really fundamentally similar and should be merged. That is because the distinction whether a property value is "synthetized" or just based on a plain property is minor. It's better to have the general concept of "convert property to GVariant" in one form only. Note that compare_property() is by default implemented based on get_func. Hence, if get_func and synth_func get merged, compare_property() will also require access to the NMConnection. Also it makes some sense: some properties are artificial and actually stored in "another" setting of the connection. But still, the property descriptor for the property is in this setting. The example is the "bond.interface-name" which only exists on D-Bus. It's stored as "connection.interface-name". I don't really like to say "exists on D-Bus only". It's still a valid property, despite in NMSetting it's stored somehow differently (or not at all). So, this is also just a regular property for which we have a property-info vtable. Does it make sense to compare such properties? Maybe. But the point is that compare_property() function needs sometimes access to the entire connection. So add the argument.
| * libnm: cleanup converting properties to GVariantThomas Haller2019-05-012-61/+99
| | | | | | | | | | | | | | | | | | | | | | Always properly set NMSettInfoProperty.dbus_type, instead of leaving it unspecified for GObject property based properties, and detect it each time anew with variant_type_for_gtype(). Instead, autodetect and remember the dbus-type during _properties_override_add_struct(). For types that need special handling (GBytes, enums and flags) set a to_dbus() function. This allows us to handle properties uniformly by either calling the to_dbus() function or g_dbus_gvalue_to_gvariant().
| * libnm: cleanup get_property_for_dbus()Thomas Haller2019-05-011-45/+51
| | | | | | | | | | | | | | | | | | | | | | - use cleanup attribute in get_property_for_dbus() and return early. - use NM_FLAGS_HAS() macro in _nm_setting_to_dbus(). - in nm_setting_get_dbus_property_type() use g_return*() asserts instead of crash or hard asserts. - return early from variant_type_for_gtype().
| * shared: add nm_g_variant_take_ref() utilThomas Haller2019-05-011-0/+8
|/
* merge: branch 'lr/tc-attrs'Lubomir Rintel2019-04-305-15/+274
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/338
| * tc/tfilter: add mirred actionLubomir Rintel2019-04-305-8/+104
| |
| * tc/qdisc: add support for fq_codel attributesLubomir Rintel2019-04-305-7/+170
|/
* merge: branch 'lr/dispatcher-split'Lubomir Rintel2019-04-306-193/+91
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/253
| * contrib/rpm: provide NetworkManager-dispatcherlr/dispatcher-splitLubomir Rintel2019-04-291-0/+2
| | | | | | | | | | | | This is a provide packages that install dispatcher scripts should depend on. It will make it easier to keep track of them and possibly split out the dispatcher into an optional package if not needed.
| * contrib/rpm: (trivial) move some %files around, remove a duplicateLubomir Rintel2019-04-291-4/+3
| | | | | | | | Just a cosmetic thing.
| * dispatcher: look for the scripts in /usr/lib as wellLubomir Rintel2019-04-292-37/+71
| | | | | | | | | | This makes it possible for packages that ship dispatcher scripts to use the correct location.
| * src/dispatcher: do not monitor dispatcher scriptsLubomir Rintel2019-04-261-145/+4
| | | | | | | | | | | | | | | | | | The monitors have been in place since the dispatcher has been introduced. They need the daemon to do extra work know where the files are supposed to be. It seems to me the complexity is not worth it. Let's remove them now, making it easier to modify the dispatcher to look for scripts in other places.
| * build: install dispatcher dirs in /usrLubomir Rintel2019-04-262-7/+11
|/ | | | | | The dispatcher looks there for scripts now. This actually doesn't break the RPM build, since it doesn't mind extra empty directories in buildroot. Good.
* cli,libnm: merge branch 'th/cli-team-cleanup'Thomas Haller2019-04-2526-936/+2080
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/121
| * ifcfg-rh: support serializaing all possible values for ethernet.s390-options ↵Thomas Haller2019-04-252-2/+10
| | | | | | | | | | | | | | | | | | | | | | (OPTIONS) While the keys of s390-options are from a well-behaving set of names (that is enforced by nm_connection_verify()), the values are arbitrary strings. Our settings plugin must be able to express all values of a connection, hence we need to support escapes.
| * libnm: refactor implementation of "ethernet.s390-options" propertyThomas Haller2019-04-256-79/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the previous implementation of nm_setting_wired_get_s390_option() returned the elements in an arbitrary order (because it just iterated idx times over the unsorted hash table). - the API for "s390-options" suggests both accessing by index and by name. Storing the options in a hash-table is not optimal for lookup by index. It also requires us to sort the elements over and over again. Use instead a sorted array. Note that add/remove of course requires to move the elements (and has thus O(n)). - "s390-options" are very seldomly set. We shouldn't pay the price in every NMSettingWired to allocate a GHashTable and deal with it. - don't assert in nm_setting_wired_add_s390_option() and nm_setting_wired_remove_s390_option() that the key is valid. ifcfg-rh reader understandably does not want to implement additional logic to pre-validate the key, so any invalid keys would trigger an assertion failure. We have verify() for this purpose.
| * libnm/keyfile: implement ethernet.s390-options in keyfileThomas Haller2019-04-252-2/+204
| | | | | | | | | | | | | | | | Currently, nm_setting_wired_get_s390_option() returns the key in an undefined order. Hence, the keyfile writer and the test need to awkwardly sort the keys first. That will be solved better in the next commit, when nm_setting_wired_get_s390_option() returns the items sorted by key.
| * shared,libnm-core: use nm_utils_named_value_list_sort()Thomas Haller2019-04-253-9/+2
| |
| * shared: add nm_utils_named_value_list_*() utilsThomas Haller2019-04-252-0/+114
| | | | | | | | | | nm_utils_named_value_list_find(), nm_utils_named_value_list_sort(), and nm_utils_named_value_list_is_sorted().
| * cli: drop GValue transform functions for strdict and implement it in ↵Thomas Haller2019-04-252-45/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | _get_fcn_gobject_impl() The only remaining GValue transform function was from GHashTable (of (str,str) type) to string. Drop that too, and implement the conversion in _get_fcn_gobject_impl(). Note that there are few GObject properties of type GHashTable and most of them implement their own logic. This only applies to "802-3-ethernet.s390-options". Also, always sort the keys. Otherwise, the output is not stable.
| * cli: drop GValue transformation of GBytes to string and implement bytes ↵Thomas Haller2019-04-252-67/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getter via _get_fcn_gobject_impl() The g_value_register_transform_func() for handling GBytes was not actually used. All properties of type G_TYPE_BYTES have their explit handler how to convert bytes to string. That is good, because the implementation there was very bad (it did not honor pretty/parsable get-type). Also, merge _get_fcn_gobject_bytes() into _get_fcn_gobject_impl(). We already have a generic handler that handles properties solely based on the GObject type: _get_fcn_gobject_impl(). Just let it also handle bytes. It's better to have fewer handlers, if they don't need special context.
| * cli: drop GValue transform function for G_TYPE_STRV to G_TYPE_STRINGThomas Haller2019-04-252-30/+31
| | | | | | | | | | | | It's ugly to modify the global behavior of glib to convert between types. Instead, _get_fcn_gobject_impl() is perfectly capable to implement converting a strv array to string.
| * cli: cleanup and fix handling of unset/empty "ipv4.dns-options"Thomas Haller2019-04-255-565/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ipv4.dns-options" and "ipv6.dns-options" are special, in that they can be either unset/default or an empty list of options. That means, nmcli must treat these two options differently. For the (terse) getter, it returns "" for default and " " for empty. The setter must likewise support and distingish between these two cases. Cleanup the handling of such options. This only applies to properties of type "multilist". Hence, add multilist.clear_emptyunset_fcn() handler that indicates that the property is of that kind. Try: nmcli connection modify "$PROFILE" ipv4.dns-options '' nmcli connection modify "$PROFILE" ipv4.dns-options ' ' and compare the output: nmcli connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -t connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -o connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p'
| * cli: add RETURN_STR_TEMPORARY() macro to "clients/common/nm-meta-setting-desc.c"Thomas Haller2019-04-251-0/+12
| | | | | | | | Will be used next.
| * cli: use escaped-tokens style for team-link-watcher list propertiesThomas Haller2019-04-251-3/+1
| | | | | | | | | | | | | | | | | | | | The link-watcher properties are not expected to contain any special values that require escaping. Hence, change the tokenizing from plain splitting at ',' to escaped-tokens style is likely to not affect any existing setups. Still, all our properties should be handled the same way (including a tokenizing which allows escaping to represent every possible value).
| * cli: refactor team-link-watcher to/from stringsThomas Haller2019-04-254-128/+336
| | | | | | | | | | | | | | | | Stricter parsing of the string: - reject attributes that don't make sense depending on the type. - reject duplicate attributes.
| * shared: fix to/from string of vlanid and missed-max values for NMTeamLinkWatcherThomas Haller2019-04-252-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vlanid and missed-max values have non-zero default values. That is what nm_utils_team_link_watcher_from_string() honors. Note that nm_utils_team_link_watcher_to_string() must omit printing the value only if it's the default value too. Otherwise, these values are not preserved during a to string conversion and back. Maybe a better fix would be to always print the values, regardless of the default value. But arguably, that is quite ugly because in most cases we don't want to cluter the string output with values that are left at the default.
| * shared/tests: add test for NMTeamLinkWatcher to/from stringThomas Haller2019-04-251-0/+220
| |
| * shared/tests: add tests for libnm-core-auxThomas Haller2019-04-256-28/+120
| | | | | | | | | | | | | | | | | | | | These tests cannot (easily) be under "shared/nm-libnm-core-aux/tests" because libnm/libnm-core requires code under shared while "nm-libnm-core-aux" requires libnm/libnm-core. With autotools that is not problem, but with meson we include sub directories in a particular order and there is no way to foward declare stuff (AFAIK). To avoid the circular dependency, add the tests to "clients/common/tests", which is always built last.