Commit Graph

23466 Commits

Author SHA1 Message Date
Lubomir Rintel
b93643ed85 core/ovs-interface: add support for dpdk type 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
f69dffe1e8 ovs/ovsdb: remove unused headers
Just include what is actually needed.
2019-06-14 12:02:23 +02:00
Lubomir Rintel
f5e82796be core/ovs-interface: fix type documentation 2019-06-14 12:02:23 +02:00
Lubomir Rintel
d0f0d778f3 merge: branch 'lr/ovs-failures'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/182
2019-06-14 11:35:46 +02:00
Lubomir Rintel
02950ec600 ovs/factory: fail the NMDevice if there's an error in OVSDB 2019-06-14 10:33:26 +02:00
Lubomir Rintel
e948ce7deb ovs/ovsdb: track the devices before we signal addition
This doesn't make any difference in practice, but it seems more correct.
It would cause issues if we decided to remove an interface from the
signal handler.
2019-06-14 10:33:26 +02:00
Lubomir Rintel
f2c066e104 ovs/ovsdb: signal a failure when an error column is set
When an interface (other OVS device types can not fail)  encounters an error
it indicates it by changing the error column. Watch for those changes so
that we can eventually communicate them to the OVS factory to deal with
them.
2019-06-14 10:33:26 +02:00
Lubomir Rintel
dedc0cba23 ovs/ovsdb: fix signal handler argument types 2019-06-14 10:33:08 +02:00
Lubomir Rintel
b1feebc43a ovs/ovsdb: remove the device-changes signal
It doesn't communicate anything about the nature of the change and
indeed nothing uses it.
2019-06-14 10:32:53 +02:00
Lubomir Rintel
99c7adc1e1 ovs/ovsdb: guard against OVSDB integrity issues
Don't crash in situations, where the bridge or a port has a child with
UUID we don't know. This could happen if we mess up the parsing of
messages from OVSDB, but could also theoretically happen in OVSDB sends
us bad data.
2019-06-14 10:32:53 +02:00
Lubomir Rintel
14271d84a0 build: only update config-extra.h if it changes
This is to avoid updating config-extra.h timestamp very time one touches
Makefile.am, because it has a large dependency chain and makes
debugging of the Makefile inconvenient.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/180
2019-06-14 09:21:24 +02:00
Thomas Haller
a646be6509 settings: merge branch 'th/various-settings-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/172
2019-06-13 16:11:15 +02:00
Thomas Haller
954906e3d1 libnm: add _nm_connection_ensure_normalized() helper 2019-06-13 16:10:53 +02:00
Thomas Haller
1a398421ff libnm: add nmtst_connection_assert_unchanging() helper 2019-06-13 16:10:53 +02:00
Thomas Haller
31382c9727 settings: remove unused NMSettingsConnection.supports_secrets() function 2019-06-13 16:10:53 +02:00
Thomas Haller
d92356c868 settings: use _nm_utils_slist_to_strv() for NMSettings:unmanaged-specs property getter
Note that now the empty list will be represented as %NULL instead of an
empty strv array.

That makes no difference in pratice. The main use of this property is as
glue for NMDBusManager to expose the property on D-Bus. Thereby it uses
g_dbus_gvalue_to_gvariant() which handles %NULL just fine.
2019-06-13 16:10:53 +02:00
Thomas Haller
ceaf64eee7 settings,libnm: move is-adhoc-wpa check to libnm
"nm-settings.c" is complex enough. Move this trivial helper function to libnm-core.
2019-06-13 16:10:53 +02:00
Thomas Haller
25de86abb6 manager: cleanup freeing CList in NMManager's dispose()
To unlink all elements, I find a while() loop easier to read
than c_list_for_each_*safe().
2019-06-13 16:10:53 +02:00
Thomas Haller
142c1215ee auth-chain: track auth-chains in embedded CList
NMManager and NMSettings both may have multiple authorization requests
ongoing. They need to keep track of them, at the very least to be able
to cancel them on shutdown.

Since NMAuthChain is not ref-countable, it always has only one clear
user/owner. It makes little sense otherwise. Since most callers already
want to track their NMAuthChain instances, let NMAuthChain help with that.

Embed a "parent" CList field inside NMAuthChain. This avoids requiring
an additional GSList allocation to track the element. Also, it allows to
link and append an element without iterating the list.

This ties the caller and the NMAuthChain a bit tighter together (making them
less indepdendent). Generally that is not desirable. But here it seems the
logic (of tracking the NMAuthChain) is still trivial and well separated.
It's just that NMAuthChain instances now can be linked in a CList.
2019-06-13 16:10:53 +02:00
Thomas Haller
a63714ec1d settings,keyfile: move openconnect hack from settings to keyfile reader
VPN settings (for openconnect) can only be handled by the keyfile settings
plugin.

In any case, such special casing belongs to the settings plugin and not
"nm-settings.c". The reason is that the settings plugin already has an
intimate understanding of the content of connections, it knows which fields
exist, their meaning, etc. It makes sense special handling of
openconnect is done there.

See also commit 304d0b869b ('core: openconnect migration hack').
Unfortunately it's not clear to me why/whether this is still the
right thing to do.
2019-06-13 16:10:53 +02:00
Thomas Haller
be0018382d settings: in have_connection_for_device() first skip over irrelevant connection types
nm_device_check_connection_compatible() is potentially expensive.
Check first whether the connection candidate is of a relevant type,
hoping that this check is cheaper and thus shortcuts other checks
early.
2019-06-13 16:10:53 +02:00
Thomas Haller
179134bbdc settings/trivial: move code around
"nm-settings.c" has more than 2000 LOC. Code that is related should be
grouped better so that it's easier to understand how it belongs
together.
2019-06-13 16:10:53 +02:00
Thomas Haller
ca1fe95ce0 settings: use nm_utils_g_slist_find_str() in update_specs()
NMSettings is complicated enough. We should try to move independent code out
of it, so that there is only logic that is essential there.

While at it, rework how we copy the GSList items. I don't like GSList as
a data structure, but there really is no need to allocate a new list.
Just unlink the list element and prepend it in the other list.
2019-06-13 16:10:53 +02:00
Thomas Haller
d7056d13d0 settings: drop nm_settings_plugin_initialize() and initialize on demand
As nm_settings_plugin_initialize() could not fail (it returned no value indicating
failure), there is no reason to explicitly call this. Instead just
initialize the plugin when needed.

Also, we don't need the plugin to initialize early before nm_settings_plugin_get_connections().
2019-06-13 16:10:53 +02:00
Thomas Haller
50be2f5244 settings: log settings plugin name
Instead of

  <info>  [1558284380.2045] settings: Loaded settings plugin: SettingsPluginIfcfg ("/usr/lib64/NetworkManager/1.19.2/libnm-settings-plugin-ifcfg-rh.so")

log

  <info>  [1558284380.2045] settings: Loaded settings plugin: ifcfg-rh ("/usr/lib64/NetworkManager/1.19.2/libnm-settings-plugin-ifcfg-rh.so")

Note how `man NetworkManager.conf` documents "main.plugins" configuration
option where settings plugins have names like "keyfile" and "ifcfg-rh".
It's not helpful to log the GObject type name, which is an implementation
detail.
2019-06-13 16:10:53 +02:00
Thomas Haller
18acdeeba5 settings: don't remember path of setting plugin
It was only kept to compare whether we loaded the same
plugin multiple times.

Note that load_plugins() already checks for duplicate plugin names,
so it actually could not happen that we tried to load the same file
more than once.
2019-06-13 16:10:53 +02:00
Thomas Haller
6da5ad2962 libnm: cleanup GSList/GPtrArray to/from strv conversion 2019-06-13 16:10:53 +02:00
Thomas Haller
c165c6a671 libnm: don't assert against %NULL string in nm_utils_is_uuid()
For a "is" check, it's inconvenient to assert against the parameter
being %NULL. We should accept %NULL and just say that it's not a valid
uuid.

This relaxes previous API.
2019-06-13 16:10:53 +02:00
Thomas Haller
b1f5e971f3 shared: add nm_g_variant_ref_sink() util 2019-06-13 16:10:53 +02:00
Thomas Haller
5b721ba90d shared: add nm_c_list_elem_find_first() and minor cleanups of NMCListElem API 2019-06-13 16:10:53 +02:00
Thomas Haller
8b2d115f9d shared: add nm_utils_g_slist_find_str() util 2019-06-13 16:10:53 +02:00
Thomas Haller
49c6fa2ba7 src/tests: show exit status in test failure of test_nm_utils_kill_child()
This test keeps randomly failing. Rework is, so that we see the actual
exit status in the output of the failed test.
2019-06-13 11:27:32 +02:00
Thomas Haller
a3e75f3294 CONTRIBUTING: style update
Also drop the paragraph about "autoconf mechanism". The general
guideline is self evident, while it didn't mention meson builds.
Also, a first time contributor likely won't likely be concerned about
this, as this is already advanced.
2019-06-12 07:31:00 +02:00
Thomas Haller
b323b3d62e CONTRIBUTING: comment that all new contributions must be made under LGPL-2.0+ license 2019-06-12 07:31:00 +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
fa0f87fef7 libnm-core: change unsupported modes for arp_ip_targets bond option
If the mode is one of '802.3ad', 'tlb' or 'alb' and the connection has
both 'arp_interval' and 'arp_ip_target' options, during normalization
we remove 'arp_interval' because unsupported in the current mode. The
connection then becomes invalid because 'arp_ip_target' requires
'arp_interval'.

Since 'arp_interval' and 'arp_ip_target' are mutually dependent, the
latter should also be unsupported for those bonding modes.

https://bugzilla.redhat.com/show_bug.cgi?id=1718173
2019-06-11 18:30:18 +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
32c6c0cdaf merge: branch 'bg/ipv6-disabled'
https://bugzilla.redhat.com/show_bug.cgi?id=1643841
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/129
2019-06-11 16:28:53 +02:00
Beniamino Galvani
40afd205db core: support creating ip6-config setting with disabled method
Create the new setting with method=disabled if IPv6 is disabled in the
sysctl.
2019-06-11 16:28:16 +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
Beniamino Galvani
5be69ba794 device: reset cached route tables when starting new activation
The values cached in the device may be stale when we start a new
activation because in a disconnected state we might have called
ip_config_merge_and_apply() which cached the main table value.
2019-06-11 15:34:59 +02:00
Thomas Haller
a4c1489507 libnm: belatedly expose nm_ethtool_optname_is_feature() in libnm
Also, plan right away to backport this symbol all the way back to
1.14.8. As such, we only need to add it once, with the right linker
version "libnm_1_14_8".

But still, the symbols first appears on a major release 1.20.0.
2019-06-11 14:58:14 +02:00
Thomas Haller
a530921f40 man: update reference for reporting bugs in man nmcli
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/188
2019-06-11 13:26:19 +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
356a159731 libnm: add nm_setting_ethtool_get_optnames() function
It's rather limiting if we have no API to ask NMSettingEthtool which
options are set.

Note that currently NMSettingEthtool only supports offload features.
In the future, it should also support other options like coalesce
or ring options. Hence, this returns all option names, not only
features.

If a caller needs to know whether the name is an option name, he/she
should call nm_ethtool_optname_is_feature().
2019-06-11 11:27:43 +02:00
Thomas Haller
1850dc4952 all: merge branch 'th/drop-emacs-file-variables'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/175
2019-06-11 10:16:35 +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
3c47285f4a all: drop vim file variables from source files
sed '1,3 { /^\(#\|--\) *vim:/d }; 1 { /^\/\* *vim:.*\*\/$/ d}' -i $(git grep -l 'vim:')
2019-06-11 10:08:07 +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