Commit Graph

82 Commits

Author SHA1 Message Date
Lubomir Rintel
24028a2246 all: SPDX header conversion
$ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
2019-09-10 11:19:56 +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
cd74fc28b5 libnm/team: strict validate team settings by libnm clients not sending the JSON
When parsing a NMSettingTeam/NMSettingTeamPort from GVariant, the JSON
"config" is always preferred. If that field is present, all other
attributes are ignored (aside from validating that the individual fields
are as expected).

The idea is that the JSON config anyway must contain everything that artificial
properties could. In this mode, also no validation is performed and the setting is
always accepted (regardless whether libnm thinks the setting verifies).

When a libnm client created the setting via the artificial properties,
only send them via D-Bus and exclude the JSON config. This turns on
strict validation server side.

Now we actually get validation of the settings:

  $ nmcli connection add type team team.runner-tx-hash l3
  Error: Failed to add 'team' connection: team.runner: runner-tx-hash is only allowed for runners loadbalance,lacp

this is obviously a change in behavior as previously all settings
would have been accepted, regardless whether they made sense.
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
f229102ddf libnm: support strict parsing of team link watcher from GVariant 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
966e0db8d7 libnm: don't duplicate NMTeamLinkWatcher and make ref thread-safe
NMTeamLinkWatcher are immutable and ref-counted.

As such, there is little reason to ever duplicate them. Just increase
the ref-count.

For this change to be safe in all cicumstances, make ref/unref of the
link watcher thread-safe. After all, NMTeamLinkWatcher is public API,
and while libnm generally is not thead-safe, the cost of this is small.
2019-05-23 18:09:49 +02:00
Thomas Haller
e923668d74 libnm: rework NMTeamLinkWatcher structure and embed strings
Don't rely on the same memory layout for the NMTeamLinkWatcher union to
hold data for the watcher types. It looks wrong and is error prone.

Also, as we no longer require the full union, we can allocate a smaller
structure for ethtool. And while at it, we can embed the strings
directly instead of allocating them separately.

The point is to have a more efficient representation (memory wise).
2019-05-23 18:09:49 +02:00
Thomas Haller
b6156e9099 libnm: add internal cmp() function for NMTeamLinkWatcher types
Add internal nm_team_link_watcher_cmp() function.

We can implement nm_team_link_watcher_equal() based on that.

This was we can sort link watchers so that nm_team_link_watchers_equal()
with ignore_order is O(n*log(n)) instead of O(n^2).

In general, as basic API cmp() functions are as much effort to implement
as equal(), but they can also be used for sorting.

In nm_team_link_watcher_cmp(), only compare the fields that are set
according to the link watcher type.
2019-05-23 18:09:49 +02:00
Thomas Haller
e28bd1289b libnm: mark NMTeamLinkWatcher arguments as const in API
NMTeamLinkWatcher is immutable, meaning there is no way to change an
existing instance (aside increasing/decreasing the ref-count).

Hence, all API is implicitly const.

Still, mark the arguments as const.
2019-05-23 18:09:49 +02:00
Thomas Haller
b1344b6b94 libnm: pass connection to compare_property() function
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.
2019-05-01 13:46:32 +02:00
Thomas Haller
126348d4be cli: implement team:runner-tx-hash as multilist property 2019-03-25 09:12:33 +01:00
Thomas Haller
2a93ce9122 libnm/team: preserve unset priv->runner_tx_hash in _align_team_properties()
There is a difference between an unset JSON array element and an empty
one. Don't loose that information.
2019-03-24 09:21:14 +01:00
Thomas Haller
5478853a0b libnm/team: check for changes to team:runner-tx-hash in _align_team_properties()
We will need to emit property changed signals. For that we need to know
whether the property changes. Compare it.
2019-03-24 09:21:14 +01:00
Thomas Haller
9d2a15514a libnm/team: add function to compare list of link-watchers 2019-03-24 09:21:14 +01:00
Thomas Haller
1283d9d321 libnm/team: minor coding style cleanup 2019-03-24 09:21:13 +01:00
Thomas Haller
047adae242 libnm/team: fix crash with nm_setting_team_remove_runner_tx_hash_by_value() having no runner_tx_hash array 2019-03-24 09:21:13 +01:00
Thomas Haller
a3370af3a8 all: drop unnecessary includes of <errno.h> and <string.h>
"nm-macros-interal.h" already includes <errno.h> and <string.h>.
No need to include it everywhere else too.
2019-02-12 08:50:28 +01:00
Thomas Haller
ce8b053674 libnm: avoid "-Wmissing-braces" warning for teams _prop_to_keys array
[1/384] Compiling C object 'libnm-core/2b1af02@@nm-core@sta/nm-setting-team.c.o'.
    ../libnm-core/nm-setting-team.c:649:77: warning: missing braces around initializer [-Wmissing-braces]
     static const _NMUtilsTeamPropertyKeys _prop_to_keys[_PROPERTY_ENUMS_LAST] = {
                                                                                 ^
      [PROP_CONFIG] =                      { NULL, NULL, NULL, 0 },
                                                               { }

And use designated initializers.
2019-02-08 20:14:50 +01:00
Beniamino Galvani
63b90f0dd1 libnm-core: fix team link-watcher struct layout
As the comment above the union says, structs in the union must have
the same layout of arp_ping. 'vlanid' is in the wrong place and breaks
that.

Fixes: f44c793f6c

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/110
2019-01-28 08:18:09 +01:00
Thomas Haller
19141ef770 libnm-core: reorder code in settings
Order the code in our common way. No other changes.

- ensure to include the main header first (directly after
  "nm-default.h").

- reorder function definitions: get_property(), set_property(),
  *_init(), *_new(), finalize(), *_class_init().
2019-01-15 09:55:24 +01:00
Thomas Haller
a3d6976efc libnm-core: cleanup NMSetting's class initialization
Unify the coding style for class-init functions in libnm-core.

Also make use of obj_properties, NM_GOBJECT_PROPERTIES_DEFINE(), and
_notify().
2019-01-15 09:55:24 +01:00
Thomas Haller
885c872d5a libnm: rework compare_property() implementation for NMSetting
NMSetting's compare_property() has and had two callers:
nm_setting_compare() and nm_setting_diff().

compare_property() accepts a NMSettingCompareFlags argument, but
at the same time, both callers have another complex (and
inconsistent!) set of pre-checks for shortcuting the call of
compare_property(): should_compare_prop().

Merge should_compare_prop() into compare_property(). This way,
nm_setting_compare() and nm_setting_diff() has less additional
code, and are simpler to follow. Especially nm_setting_compare()
is now trivial. And nm_setting_diff() is still complicated, but
not related to the question how the property compares or whether
it should be compared at all.

If you want to know whether it should be compared, all you need to do
now is follow NMSettingClass.compare_property().

This changes function pointer NMSettingClass.compare_property(),
which is public API. However, no user can actually use this (and shall
not!), because _nm_setting_class_commit_full() etc. is private API. A
user outside of libnm-core cannot create his/her own subclasses of
NMSetting, and never could in the past. So, this API/ABI change doesn't
matter.
2019-01-11 11:48:47 +01:00
Thomas Haller
99befe7e51 libnm: implement nm_team_link_watcher_new_arp_ping() based on nm_team_link_watcher_new_arp_ping2()
nm_team_link_watcher_new_arp_ping2() is the more powerful variant of
nm_team_link_watcher_new_arp_ping(). It can do everything the new
variant can, and more.

Hence, v1 should be implemented based on v2. This way, validating and
constructing the watcher is all done in one place, not split in two places.
2018-12-12 14:07:50 +01:00
Patrick Talbert
f44c793f6c team: add support for 'vlanid' link-watchers property
Add support for the teaming arp_ping link watcher 'vlanid' property.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>

[thaller@redhat.com: minor fixes to original patch]

https://bugzilla.redhat.com/show_bug.cgi?id=1652931
2018-12-12 14:07:30 +01:00
Beniamino Galvani
17a942b458 libnm-core: fix other int comparisons in team setting
I forgot to update them when applying commit 72b4541771.

Fixes: 72b4541771
2018-10-08 11:28:14 +02:00
Thomas Haller
72b4541771 libnm-core: fix int comparisons in team setting 2018-10-07 13:57:11 +02:00
Rafael Fontenelle
34fd628990 Fix typos
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/21

[thaller@redhat.com: fix generated clients/common/settings-docs.h.in file
   and fix wrong change in src/systemd/src/libsystemd/sd-event/sd-event.c]
2018-09-30 21:14:55 +02:00
luz.paz
58510ed566 docs: misc. typos pt2
Remainder of typos found using `codespell -q 3 --skip="./shared,./src/systemd,*.po" -I ../NetworkManager-word-whitelist.txt` whereby whitelist consists of:
 ```
ans
busses
cace
cna
conexant
crasher
iff
liftime
creat
nd
sav
technik
uint
```

https://github.com/NetworkManager/NetworkManager/pull/205
2018-09-17 11:26:13 +02:00
Thomas Haller
3793804314 libnm: rework setting metadata for property handling
NMSetting internally already tracked a list of all proper GObject properties
and D-Bus-only properties.

Rework the tracking of the list, so that:

- instead of attaching the data to the GType of the setting via
  g_type_set_qdata(), it is tracked in a static array indexed by
  NMMetaSettingType. This allows to find the setting-data by simple
  pointer arithmetic, instead of taking a look and iterating (like
  g_type_set_qdata() does).

  Note, that this is still thread safe, because the static table entry is
  initialized in the class-init function with _nm_setting_class_commit().
  And it only accessed by following a NMSettingClass instance, thus
  the class constructor already ran (maybe not for all setting classes,
  but for the particular one that we look up).

  I think this makes initialization of the metadata simpler to
  understand.
  Previously, in a first phase each class would attach the metadata
  to the GType as setting_property_overrides_quark(). Then during
  nm_setting_class_ensure_properties() it would merge them and
  set as setting_properties_quark(). Now, during the first phase,
  we only incrementally build a properties_override GArray, which
  we finally hand over during nm_setting_class_commit().

- sort the property infos by name and do binary search.

Also expose this meta data types as internal API in nm-setting-private.h.
While not accessed yet, it can prove beneficial, to have direct (internal)
access to these structures.

Also, rename NMSettingProperty to NMSettInfoProperty to use a distinct
naming scheme. We already have 40+ subclasses of NMSetting that are called
NMSetting*. Likewise, NMMetaSetting* is heavily used already. So, choose a
new, distinct name.
2018-08-10 10:38:19 +02:00
Thomas Haller
9c47e2ce30 libnm: use NMMetaSettingInfo for tracking setting priority
Previously, each (non abstract) NMSetting class had to register
its name and priority via _nm_register_setting().

Note, that libnm-core.la already links against "nm-meta-setting.c",
which also redundantly keeps track of the settings name and gtype
as well.

Re-use NMMetaSettingInfo also in libnm-core.la, to track this meta
data.

The goal is to get rid of private data structures that track
meta data about NMSetting classes. In this case, "registered_settings"
hash. Instead, we should have one place where all this meta data
is tracked. This was, it is also accessible as internal API,
which can be useful (for keyfile).

Note that NMSettingClass has some overlap with NMMetaSettingInfo.
One difference is, that NMMetaSettingInfo is const, while NMSettingClass
is only initialized during the class_init() method. Appart from that,
it's mostly a matter of taste, whether we attach meta data to
NMSettingClass, to NMMetaSettingInfo, or to a static-array indexed
by NMMetaSettingType.

Note, that previously, _nm_register_setting() was private API. That
means, no user could subclass a functioning NMSetting instance. The same
is still true: NMMetaSettingInfo is internal API and users cannot access
it to create their own NMSetting subclasses. But that is almost desired.
libnm is not designed, to be extensible via subclassing, nor is it
clear why that would be a useful thing to do. One day, we should remove
the NMSetting and NMSettingClass definitions from public headers. Their
only use is subclassing the types, which however does not work.

While libnm-core was linking already against nm-meta-setting.c,
nm_meta_setting_infos was unreferenced. So, this change increases
the binary size of libnm and NetworkManager (1032 bytes). Note however
that roughly the same information was previously allocated at runtime.
2018-08-10 10:38:19 +02:00
Thomas Haller
23adc37377 libnm/trivial: cleanup variable names in settings' class-init functions
- Don't use @parent_class name. This local variable (and @object_class) is
  the class instance up-cast to the pointer types of the parents. The point
  here is not that it is the direct parent. The point is, that it's the
  NMSettingClass type.
  Also, it can only be used inconsistently, in face of NMSettingIP4Config,
  who's parent type is NMSettingIPConfig. Clearly, inside
  nm-setting-ip4-config.c we wouldn't want to use the "parent_class"
  name. Consistently rename @parent_class to @setting_class.

- Also rename the pointer to the own class to @klass. "setting_class" is also the
  wrong name for that, because the right name would be something like
  "setting_6lowpan_class".
  However, "klass" is preferred over the latter, because we commonly create new
  GObject implementations by copying an existing one. Generic names like "klass"
  and "self" inside a type implementation make that simpler.

- drop useless comments like

     /* virtual functions */
     /* Properties */

  It's better to logically and visually structure the code, and avoid trival
  remarks about that. They only end up being used inconsistently. If you
  even need a stronger visual separator, then an 80 char /****/ line
  should be preferred.
2018-08-10 10:38:19 +02:00
Beniamino Galvani
a2846bd735 libnm-core: don't emit signal when clearing lists already empty
If the property is a list and it is already empty, we should not emit
a signal when it gets cleared.
2018-07-11 16:16:22 +02:00
Thomas Haller
e1c7a2b5d0 all: don't use gchar/gshort/gint/glong but C types
We commonly don't use the glib typedefs for char/short/int/long,
but their C types directly.

    $ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
    587
    $ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
    21114

One could argue that using the glib typedefs is preferable in
public API (of our glib based libnm library) or where it clearly
is related to glib, like during

  g_object_set (obj, PROPERTY, (gint) value, NULL);

However, that argument does not seem strong, because in practice we don't
follow that argument today, and seldomly use the glib typedefs.
Also, the style guide for this would be hard to formalize, because
"using them where clearly related to a glib" is a very loose suggestion.

Also note that glib typedefs will always just be typedefs of the
underlying C types. There is no danger of glib changing the meaning
of these typedefs (because that would be a major API break of glib).

A simple style guide is instead: don't use these typedefs.

No manual actions, I only ran the bash script:

  FILES=($(git ls-files '*.[hc]'))
  sed -i \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>  /\1   /g' \
      -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
      "${FILES[@]}"
2018-07-11 12:02:06 +02:00
Thomas Haller
fa9fe466db libnm: avoid constructor function for registering NMSetting types
constructor functions are ugly, because code is running before
main() starts. Instead, as the registration code for NMSetting types
is insid the GType constructor, we just need to ensure at the
right place, that the GType was created.

The right place here is _register_settings_ensure_inited(), because
that is called before we need the registration information.
2018-07-01 18:17:31 +02:00
Francesco Giudici
ba5feb8ca8 man: add 'random' to the allowed values of team.runner
https://bugzilla.redhat.com/show_bug.cgi?id=1543832
2018-06-15 16:14:49 +02:00
Beniamino Galvani
1b5925ce88 all: remove consecutive empty lines
Normalize coding style by removing consecutive empty lines from C
sources and headers.

https://github.com/NetworkManager/NetworkManager/pull/108
2018-04-30 16:24:52 +02:00
Corentin Noël
468a019333 gobject-introspection: made several fixes to the annotations
https://bugzilla.gnome.org/show_bug.cgi?id=794658
2018-03-26 12:45:49 +02:00
Thomas Haller
e4839accf5 all: replace non-leading tabs with spaces
We commonly only allow tabs at the beginning of a line, not
afterwards. The reason for this style is so that the code
looks formated right with tabstop=4 and tabstop=8.
2018-02-07 13:32:04 +01:00
Francesco Giudici
31d9a9de14 libnm-core: team: add support to runner "random"
https://bugzilla.redhat.com/show_bug.cgi?id=1538699
2018-02-05 15:24:36 +01:00
Francesco Giudici
381c1a19b6 libnm-core: ensure alignment of team.config and other team properties
https://bugzilla.redhat.com/show_bug.cgi?id=1533830
2018-01-22 19:16:09 +01:00
Francesco Giudici
112f8bd5af libnm-core: update team.runner description
https://bugzilla.redhat.com/show_bug.cgi?id=1533799
2018-01-12 14:22:43 +01:00
Thomas Haller
fb2da4b26c libnm: fix checking argument in nm_team_link_watcher_new_arp_ping()
Found by coverity.

Fixes: 6c93e32212
2017-12-12 11:15:38 +01:00
Thomas Haller
6c93e32212 libnm: don't use g_strsplit_set() to search string for invalid characters 2017-12-08 11:09:34 +01:00
Francesco Giudici
4c7a841823 libnm-core: team: change tx-hash APIs idx type from int to guint 2017-12-08 00:46:27 +01:00
Francesco Giudici
a5642fd93a libnm-core: team: rework defaults management on runner properties
till now when no explicit value was set on a property, the default value
for that property was returned, also if the property was not applicable
to the selected runner.
Fix this, showing default values for properties only when relevant and
showing instead -1 or null when the property is not relevant for the
selected runner.
Moreover, reset all the properties but the link-watchers when the team.runner
is changed: this is required to clean up the properties unrelated to the
new runner and start with the runner-specific defaults.
2017-12-08 00:46:27 +01:00
Francesco Giudici
ed2a1a153b libnm-core: team: use the correct name for teamd property 'balancing_interval'
the teamd 'runner.tx_balancer.balancing_interval' property was wrongly
set and searched as 'runner.tx_balancer.interval'. Fixed.

Fixes: fc3b7d61e2
2017-12-08 00:46:27 +01:00
Francesco Giudici
363a2cfe95 libnm-core: synchronize team.link_watchers when team.config is set. 2017-12-08 00:46:26 +01:00
Francesco Giudici
e59878ce19 libnm-core: synchronize team.config when team.link_watchers is set. 2017-12-08 00:46:26 +01:00
Francesco Giudici
ca816ae10e libnm-core: team: expose the new link-watchers property
It will allow explicit configuration of link-watchers in the team
configuration.
2017-12-08 00:46:26 +01:00