Commit Graph

1539 Commits

Author SHA1 Message Date
Lubomir Rintel
bd119981a1 clients: add ovs-dpdk interface support 2019-06-14 12:10:20 +02:00
Lubomir Rintel
a26abc797c libnm-core: add ovs-dpdk setting 2019-06-14 12:10:20 +02:00
Lubomir Rintel
f5e82796be core/ovs-interface: fix type documentation 2019-06-14 12:02:23 +02:00
Beniamino Galvani
b247950c6f tui: add only some options to new bond connections
Instead of adding every known option to new bond connections, only add
the ones supported by UI.

https://bugzilla.redhat.com/show_bug.cgi?id=1715720
2019-06-11 18:30:20 +02:00
Beniamino Galvani
6a3bb90ad4 cli: fix crash on autocompletion
@connections is NULL when doing autocompletion. Fixes the following:

 $ nmcli --complete-args con monitor ""
  help
  id
  uuid
  path
  filename
  ...
  Segmentation fault (core dumped)

Fixes: 4b3297271e ('cli: rework connection handling for multiple results')

https://bugzilla.redhat.com/show_bug.cgi?id=1716948
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/177
2019-06-11 16:44:06 +02:00
Beniamino Galvani
e6628fa27c ipv6: add 'disabled' method
Add a new ipv6.method value 'disabled' that completely disables IPv6
for the interface.

https://bugzilla.redhat.com/show_bug.cgi?id=1643841
2019-06-11 16:22:04 +02:00
Thomas Haller
91d8038a81 cli: fix default value for team.runner-min-ports
The default value is "1", not "0". Also, because "0" is not actually a
valid value as far as teamd is concerned. This fixes:

    $ nmcli connection add type team autoconnect no con-name t team.runner lacp team.runner-min-ports default
    Error: Failed to add 't' connection: team.runner-min-ports: value out or range

See "teamd.conf" manual:

    runner.min_ports (int)
        Specifies the minimum number of ports that must be active before asserting
        carrier in the master interface, value can be 1 – 255.

        Default: 1

This mistake probably happend because the teamd manual is wrong in older versions [1].

[1] f36c191da3

https://bugzilla.redhat.com/show_bug.cgi?id=1716987
2019-06-11 13:25:21 +02:00
Thomas Haller
87a73df959 all: drop empty first line from sources
git ls-files -z -- ':(exclude)src/settings/plugins/keyfile/tests/keyfiles' | xargs -0 -n1 sed -i '1 { /^$/d }'
2019-06-11 10:15:06 +02:00
Thomas Haller
c0e075c902 all: drop emacs file variables from source files
We no longer add these. If you use Emacs, configure it yourself.

Also, due to our "smart-tab" usage the editor anyway does a subpar
job handling our tabs. However, on the upside every user can choose
whatever tab-width he/she prefers. If "smart-tabs" are used properly
(like we do), every tab-width will work.

No manual changes, just ran commands:

    F=($(git grep -l -e '-\*-'))
    sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
    sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"

Check remaining lines with:

    git grep -e '-\*-'

The ultimate purpose of this is to cleanup our files and eventually use
SPDX license identifiers. For that, first get rid of the boilerplate lines.
2019-06-11 10:04:00 +02:00
Thomas Haller
dfa8ecdab8 cli: remove unnecessary workaround for clearing team link watchers and runner-tx-hash
This is fixed in libnm. Resetting the GObject property clears the list
of watchers and tx-hashes.

Since nmcli requires a libnm version >= itself, this workaround
is no longer necessary.
2019-06-04 15:48:30 +02:00
Thomas Haller
23b1f8234d libnm/team: fix handling default values and stricter validate team config
For each artifical team property we need to track whether it was
explicitly set (i.e., present in JSON/GVariant or set by the user
via NMSettingTeam/NMSettingTeamPort API).

 --

As a plus, libnm is now no longer concerned with the underling default values
that teamd uses. For example, the effective default value for "notify_peers.count"
depends on the selected runner. But libnm does not need to care, it only cares
wheher the property is set in JSON or not. This also means that the default (e.g. as
interesting to `nmcli -o con show $PROFILE`) is independent from other properties
(like the runner).

Also change the default value for the GObject properties of
NMSettingTeam and NMSettingTeamPort to indicate the "unset" value.
For most properties, the default value is a special value that is
not a valid configuration itself.
For some properties the default value is itself a valid value, namely,
"runner.active", "runner.fast_rate", "port.sticky" and "port.prio".

As far as NMTeamSetting is concerned, it distinguishes between unset
value and set value (including the default value). That means,
when it parses a JSON or GVariant, it will remember whether the property
was present or not.

When using API of NMSettingTeam/NMSettingTeamPort to set a property to the
default value, it marks the property as unset. For example, setting
NM_SETTING_TEAM_RUNNER_ACTIVE to TRUE (the default), means that the
value will not be serialized to JSON/GVariant. For the above 4
properties (where the default value is itself a valid value) this is a
limitation of libnm API, as it does not allow to explicitly set
'"runner": { "active": true }'. See SET_FIELD_MODE_SET_UNLESS_DEFAULT,

Note that changing the default value for properties of NMSetting is problematic,
because it changes behavior for how settings are parsed from keyfile/GVariant.
For team settings that's not the case, because if a JSON "config" is
present, all other properties are ignore. Also, we serialize properties
to JSON/GVariant depending on whether it's marked as present, and not
whether the value is set to the default (_nm_team_settings_property_to_dbus()).

 --

While at it, sticter validate the settings. Note that if a setting is
initialized from JSON, the strict validation is not not performed. That
means, such a setting will always validate, regardless whether the values
in JSON are invalid according to libnm. Only when using the extended
properties, strict validation is turned on.

Note that libnm serializes the properties to GVariant both as JSON "config"
and extended properties. Since when parsing a setting from GVariant will
prefer the "config" (if present), in most cases also validation is
performed.

Likewise, settings plugins (keyfile, ifcfg-rh) only persist the JSON
config to disk. When loading a setting from file, strict validation is
also not performed.

The stricter validation only happens if as last operation one of the
artificial properties was set, or if the setting was created from a
GVariant that has no "config" field.

 --

This is a (another) change in behavior.
2019-06-04 15:48:15 +02:00
Thomas Haller
403f207fe5 cli: fix resetting default value for GObject property
This matters for properties that don't have 0/NULL/FALSE as
default value and when setting an empty property with

  $ nmcli connection modify "$PROFILE" setting.property ''

Fixes: 3c82db710f ('cli: reset default value of properties via set_fcn()')
2019-05-31 15:52:29 +02:00
Francesco Giudici
58eee5896d cli: enforce int type in for loops 2019-05-29 11:37:42 +02:00
Thomas Haller
7af1fc803e clients/tests: increase timeout waiting for stub D-Bus service
I saw this timeout reached in our gitlab-ci. I think it was due to the machine
being busy and taking more than 2 seconds. Assuming the timeout was just too short,
increase it to 4 seconds.
2019-05-29 09:42:40 +02:00
Lubomir Rintel
9c24c81ad0 cli: don't force interface name on add_and_activate
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.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/140
2019-05-28 14:40:18 +02:00
Thomas Haller
74d0a5bf9a nmcli: don't validate team config in nmcli
nm_connection_verify() can already validate team settings just fine.
No need to duplicate this.
2019-05-23 18:09:49 +02:00
Thomas Haller
13f6f3a410 libnm: rework team handling of JSON config
Completely refactor the team/JSON handling in libnm's NMSettingTeam and
NMSettingTeamPort.

- team handling was added as rh#1398925. The goal is to have a more
  convenient way to set properties than constructing JSON. This requires
  libnm to implement the hard task of parsing JSON (and exposing well-understood
  properties) and generating JSON (based on these "artificial" properties).
  But not only libnm. In particular nmcli and the D-Bus API must make this
  "simpler" API accessible.

- since NMSettingTeam and NMSettingTeamPort are conceptually the same,
  add "libnm-core/nm-team-utils.h" and NMTeamSetting that tries to
  handle the similar code side-by-sdie.
  The setting classes now just delegate for everything to NMTeamSetting.

- Previously, there was a very fuzzy understanding of the provided
  JSON config. Tighten that up, when setting a JSON config it
  regenerates/parses all other properties and tries to make the
  best of it. When modifying any abstraction property, the entire
  JSON config gets regenerated. In particular, don't try to merge
  existing JSON config with the new fields. If the user uses the
  abstraction API, then the entire JSON gets replaced.

  For example note that nm_setting_team_add_link_watcher() would not
  be reflected in the JSON config (a bug). That only accidentally worked
  because client would serializing the changed link watcher to
  GVariant/D-Bus, then NetworkManager would set it via g_object_set(),
  which would renerate the JSON, and finally persist it to disk. But
  as far as libnm is concerned, nm_setting_team_add_link_watcher() would
  bring the settings instance in an inconsistent state where JSON and
  the link watcher property disagree. Setting any property must
  immediately update both the JSON and the abstraction API.

- when constucting a team setting from D-Bus, we would previously parse
  both "config" and abstraction properties. That is wrong. Since our
  settings plugins only support JSON, all information must be present
  in the JSON config anyway. So, when "config" is present, only the JSON
  must be parsed. In the best case, the other information is redudant and
  contributes nothing. In the worse case, they information differs
  (which might happen if the client version differs from the server
  version). As the settings plugin only supports JSON, it's wrong to
  consider redundant, differing information from D-Bus.

- we now only convert string to JSON or back when needed. Previously,
  setting a property resulted in parsing several JSON multiple times
  (per property). All operations should now scale well and be reasonably
  efficient.

- also the property-changed signals are now handled correctly. Since
  NMTeamSetting knows the current state of all attributes, it can emit
  the exact property changed signals for what changed.

- we no longer use libjansson to generate the JSON. JSON is supposed
  to be a machine readable exchange format, hence a major goal is
  to be easily handled by applications. While parsing JSON is not so
  trivial, writing a well-known set of values to JSON is.
  The advantage is that when you build libnm without libjansson support,
  then we still can convert the artificial properties to JSON.

- Requiring libjansson in libnm is a burden, because most of the time
  it is not needed (as most users don't create team configurations). With
  this change we only require it to parse the team settings (no longer to
  write them). It should be reasonably simple to use a more minimalistic
  JSON parser that is sufficient for us, so that we can get rid of the
  libjansson dependency (for libnm). This also avoids the pain that we have
  due to the symbol collision of libjansson and libjson-glib.

https://bugzilla.redhat.com/show_bug.cgi?id=1691619
2019-05-23 18:09:49 +02:00
Thomas Haller
0c7bc1a5d9 clients/tests: rename clients/common's "test-general" to "test-clients-common" 2019-05-19 14:00:16 +02:00
Jonas DOREL
13be449296 doc: replace "Split DNS" with "Conditional Forwarding"
Split DNS usually refers to "Split Horizon DNS" whereas "Conditional
Forwarding" is specifically for what the documentation describes.

[thaller@redhat.com: rewrote commit message]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/143
2019-05-17 12:08:45 +02:00
Beniamino Galvani
c91aad4969 cli: hide certificate blobs unless --show-secrets is passed
This restores the behavior before commit 99711579ed.

Fixes: 99711579ed ('cli: add property type for 802-1x certificate properties (pt2)').
2019-05-06 10:10:00 +02:00
Beniamino Galvani
ec4a12ecdb cli: complete 802.1x certificate file names 2019-05-06 10:10:00 +02:00
Beniamino Galvani
eb724293c2 cli: allow completing filenames
Allow the completion function to indicate that the word should be
completed as a filename by the shell.
2019-05-06 10:10:00 +02:00
Beniamino Galvani
78b9448b69 cli: remove bluetooth completion code
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.
2019-05-06 10:10:00 +02:00
Beniamino Galvani
eac15501b2 cli: parse escape sequences when reading an 802.1x private key
In this way it become possible to specify a filename that includes one
of the delimiters.
2019-05-06 10:10:00 +02:00
Beniamino Galvani
ee96387578 cli: fix setting private key password
Fixes: fe390556ab ('cli: add property type for 802-1x certificate properties (pt3)')
2019-05-06 10:10:00 +02:00
Thomas Haller
020c4c81d8 cli: drop GValue transform functions for strdict and implement it in _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.
2019-04-25 08:20:03 +02:00
Thomas Haller
e55a45faa2 cli: drop GValue transformation of GBytes to string and implement bytes 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.
2019-04-25 08:20:03 +02:00
Thomas Haller
d4d1e5f00d cli: drop GValue transform function for G_TYPE_STRV to G_TYPE_STRING
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.
2019-04-25 08:20:03 +02:00
Thomas Haller
655a920577 cli: cleanup and fix handling of unset/empty "ipv4.dns-options"
"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'
2019-04-25 08:13:02 +02:00
Thomas Haller
bee4d30bec cli: add RETURN_STR_TEMPORARY() macro to "clients/common/nm-meta-setting-desc.c"
Will be used next.
2019-04-25 07:53:48 +02:00
Thomas Haller
d76f3748de cli: use escaped-tokens style for team-link-watcher list properties
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).
2019-04-25 07:50:59 +02:00
Thomas Haller
a473ab431a cli: refactor team-link-watcher to/from strings
Stricter parsing of the string:

- reject attributes that don't make sense depending on the type.

- reject duplicate attributes.
2019-04-25 07:50:47 +02:00
Thomas Haller
2800574221 shared: fix to/from string of vlanid and missed-max values for NMTeamLinkWatcher
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.
2019-04-25 07:49:56 +02:00
Thomas Haller
2aa81edeaf shared/tests: add test for NMTeamLinkWatcher to/from string 2019-04-25 07:49:56 +02:00
Thomas Haller
7a25f67af7 shared/tests: add tests for libnm-core-aux
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.
2019-04-25 07:47:37 +02:00
Thomas Haller
db9fbcee6c cli,shared: move NMTeamLinkWatcher to/from string function to "nm-libnm-core-aux.h"
to/from string functions are useful. We should be able to reuse them.
Move them to their own location.

Also, it moves independent code out of "clients/common/nm-meta-setting-desc.c"
which is already one of the largest source files we have.

Also, it makes the code unit-testable, which is obviously required
as the code has bugs.
2019-04-25 07:46:17 +02:00
Beniamino Galvani
2d347e7e17 cli: don't wait for connection change on update failure
When saving a connection, we wait the connection-changed signal before
proceeding to ensure that the remote connection is up to date.
However, no signal is emitted if the update fails and so we shouldn't
wait for it.

Fixes: a370faeb59 ('cli: wait for changed signal after updating a connection'):

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/124
https://bugzilla.redhat.com/show_bug.cgi?id=1702203
2019-04-24 16:18:25 +02:00
Thomas Haller
c27ad37c27 build/meson: rename "nm_core_dep" to "libnm_core_dep"
The library is called "libnm_core". So the dependency should be called
"libnm_core_dep", like in all other cases.
2019-04-18 18:59:09 +02:00
Thomas Haller
af07ed01c0 shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core
"libnm-core" implements common functionality for "NetworkManager" and
"libnm".

Note that clients like "nmcli" cannot access the internal API provided
by "libnm-core". So, if nmcli wants to do something that is also done by
"libnm-core", , "libnm", or "NetworkManager", the code would have to be
duplicated.

Instead, such code can be in "libnm-libnm-core-{intern|aux}.la".
Note that:

  0) "libnm-libnm-core-intern.la" is used by libnm-core itsself.
     On the other hand, "libnm-libnm-core-aux.la" is not used by
     libnm-core, but provides utilities on top of it.

  1) they both extend "libnm-core" with utlities that are not public
     API of libnm itself. Maybe part of the code should one day become
     public API of libnm. On the other hand, this is code for which
     we may not want to commit to a stable interface or which we
     don't want to provide as part of the API.

  2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core"
     and thus directly available to "libnm" and "NetworkManager".
     On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm"
     and "NetworkManager".
     Both libraries may be statically linked by libnm clients (like
     nmcli).

  3) it must only use glib, libnm-glib-aux.la, and the public API
     of libnm-core.
     This is important: it must not use "libnm-core/nm-core-internal.h"
     nor "libnm-core/nm-utils-private.h" so the static library is usable
     by nmcli which couldn't access these.

Note that "shared/nm-meta-setting.c" is an entirely different case,
because it behaves differently depending on whether linking against
"libnm-core" or the client programs. As such, this file must be compiled
twice.
2019-04-18 18:59:09 +02:00
Thomas Haller
80db06f768 shared: move most of "shared/nm-utils" to "shared/nm-glib-aux"
From the files under "shared/nm-utils" we build an internal library
that provides glib-based helper utilities.

Move the files of that basic library to a new subdirectory
"shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
to "libnm-glib-aux.la".

Reasons:

 - the name "utils" is overused in our code-base. Everything's an
   "utils". Give this thing a more distinct name.

 - there were additional files under "shared/nm-utils", which are not
   part of this internal library "libnm-utils-base.la". All the files
   that are part of this library should be together in the same
   directory, but files that are not, should not be there.

 - the new name should better convey what this library is and what is isn't:
   it's a set of utilities and helper functions that extend glib with
   funcitonality that we commonly need.

There are still some files left under "shared/nm-utils". They have less
a unifying propose to be in their own directory, so I leave them there
for now. But at least they are separate from "shared/nm-glib-aux",
which has a very clear purpose.
2019-04-18 18:59:09 +02:00
Thomas Haller
7f01da917e cli: use "escaped-tokens" style for splitting "vlan.xgress-priority-map" list
There should be little difference here, because the priority list is
(and was) never serialized with special characters like backslashes or
delimiters that require escaping.

Likewise, no working code actually tried to set such characters.

Still, drop the plain VALUE_STRSPLIT_MODE_STRIPPED and use
VALUE_STRSPLIT_MODE_ESCAPED_TOKENS_WITH_SPACES instead. We should have
a small set of modes that we use for splitting strings.
2019-04-18 18:49:12 +02:00
Thomas Haller
bbfd366805 cli: cleanup _get_fcn_vlan_xgress_priority_map()
- merge the pointless helper function vlan_priorities_to_string()
  into the only caller _get_fcn_vlan_xgress_priority_map().

- minor cleanups, like setting out-is-default if num==0, not
  based on whether we have a non-empty string. There is not difference
  in practice, because nm_setting_vlan_get_priority() never fails.
  Hence they are identical. But nm_setting_vlan_get_priority() has
  an API that allows it to fail, so we should declare the default
  depending on the number of vlan priorities.

- don't allocate the temporary GString instance if we won't need it.

- only append the delimiter if needed, and not truncate it afterwards.
  It might have even worse performance this way, but it feels more
  correct to me.

- also cache the result of nm_setting_vlan_get_num_priorities().
  NMSettingVlan's implementation is horrible and uses a GSList to
  track the list of priorities. This makes it relatively expensive
  to call get-num-priorities repeatedly (and pointless).
2019-04-18 18:49:00 +02:00
Thomas Haller
7a92fb6bf4 cli: unify set of characters to tokenize list properties
the only change in behaviour is for VALUE_STRSPLIT_MODE_MULTILIST.
Previously, we would split at " \t,", now we will also split at
the white space characters "\n\r\f".
2019-04-18 17:53:09 +02:00
Thomas Haller
6093f49304 cli: refactor multilist property handling of "match.interface-names"
We had %VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE, which was used
by "match.interface-names". This uses nm_utils_strsplit_set_full()
with %NM_UTILS_STRSPLIT_SET_FLAGS_ALLOW_ESCAPING and
_nm_utils_unescape_plain().

We want eventually to use nm_utils_escaped_tokens_split() everywhere.

We already have %VALUE_STRSPLIT_MODE_ESCAPED_TOKENS, which splits the
list at ',' (and strips whitespaces at the around the delimiter). That
differs from what %VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE did, which
also considered whitespace a delimiter.

So, we need a new mode %VALUE_STRSPLIT_MODE_ESCAPED_TOKENS_WITH_SPACES
which replaces the previous mode.

Note that the previous implementation did almost the same thing. In
fact, I cannot imagine examples where they behaved differently, but
my feeling is that there might be some edge cases where this changes
behavior.
2019-04-18 17:53:09 +02:00
Thomas Haller
b74d9a0bd5 cli: return early when splitting with %VALUE_STRSPLIT_MODE_STRIPPED
The reminder of the function only does (something akin to) g_strstrip().
As we split the strings are spaces to begin with, there is nothing to
strip and we can return right away.
2019-04-18 17:53:09 +02:00
Thomas Haller
3f5df5ab72 cli: drop unused strsplit_with_escape mode for objlist properties 2019-04-18 17:53:09 +02:00
Thomas Haller
84bd1d38df cli: assert for proper escaping when creating objlist string 2019-04-18 17:53:09 +02:00
Thomas Haller
5a71592087 cli: default splitting list properties with escaped-tokens style
When splitting (and concatenating) list-typed properties,
we really should use nm_utils_escaped_tokens_split()
and nm_utils_escaped_tokens_escape*().

Make that the default, and mark all properties to opt-in to the
legacy behavior.
2019-04-18 17:53:09 +02:00
Thomas Haller
758bf32640 cli: fix splitting of multilist property in setter
The modes VALUE_STRSPLIT_MODE_OBJLIST* and VALUE_STRSPLIT_MODE_MULTILIST* are
different. We must use the right mode.

For example, _get_fcn_match_interface_name() concatenates the interface-names
with space. So, the tokenizer of the setter must also use space as delimiter.
VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE does that correctly,
VALUE_STRSPLIT_MODE_OBJLIST_WITH_ESCAPE does not.
2019-04-18 17:53:09 +02:00
Thomas Haller
6bef72364d cli: fix handling empty match.interface-name property 2019-04-18 17:53:09 +02:00