summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* cli: fix default value for team.runner-min-portsThomas Haller2019-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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] https://github.com/jpirko/libteam/commit/f36c191da3d65a4744582b2eb09fa297dd85f9ae https://bugzilla.redhat.com/show_bug.cgi?id=1716987
* libnm: add nm_setting_ethtool_get_optnames() functionThomas Haller2019-06-113-0/+39
| | | | | | | | | | | | | 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().
* all: merge branch 'th/drop-emacs-file-variables'Thomas Haller2019-06-11777-974/+75
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/175
| * all: drop empty first line from sourcesThomas Haller2019-06-1187-87/+0
| | | | | | | | git ls-files -z -- ':(exclude)src/settings/plugins/keyfile/tests/keyfiles' | xargs -0 -n1 sed -i '1 { /^$/d }'
| * all: drop vim file variables from source filesThomas Haller2019-06-1137-37/+0
| | | | | | | | sed '1,3 { /^\(#\|--\) *vim:/d }; 1 { /^\/\* *vim:.*\*\/$/ d}' -i $(git grep -l 'vim:')
| * all: drop emacs file variables from source filesThomas Haller2019-06-11775-775/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * examples: use '\n' line endings in "examples/C/qt/add-connection-wired.cpp"Thomas Haller2019-06-111-76/+76
|/ | | | | | | | | | Find with: git ls-files -z | xargs -0 file | grep with\ CRLF Fix with: dos2unix examples/C/qt/add-connection-wired.cpp
* initrd/tests: increase test timeout for "initrd/test-cmdline-reader" with mesonThomas Haller2019-06-111-0/+1
| | | | | The default timeout of 30 seconds may not be sufficient when running under valgrind on a busy system.
* platform: merge branch 'th/platform-link-broadcast'Thomas Haller2019-06-1121-206/+313
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/174
| * platform: avoid heap allocating string buffer for printing link flagsThomas Haller2019-06-113-15/+46
| |
| * platform: handle IFLA_BROADCAST in platform cache for linksThomas Haller2019-06-117-67/+136
| | | | | | | | | | | | While at it, rename the "addr" field to "l_address". The term "addr" is used over and over. Instead we should use distinct names that make it easier to navigate the code.
| * shared: add nmtst_get_rand_uint() helperThomas Haller2019-06-111-0/+7
| |
| * tests/trivial: rename nmtst_get_rand_int() to nmtst_get_rand_uint32()Thomas Haller2019-06-1113-123/+123
| | | | | | | | | | | | | | | | nmtst_get_rand_int() was originally named that way, because it calls g_rand_int(). But I think if a function returns an uint32, it should also be named that way. Rename.
| * shared: use NM_MIN() in NM_CMP_FIELD_MEMCMP_LEN() macroThomas Haller2019-06-111-1/+1
|/ | | | To avoid evaluating the argument more than once.
* dhcp: fallback to "internal" DHCP plugin if plugin does not support address ↵Thomas Haller2019-06-113-28/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | family Maybe DHCP plugins should be configurable per address family and be re-loadable via SIGHUP. But that just adds complexity. Nowadays we always have the "internal" DHCP plugin, which is known to support both IPv4 and IPv6. One day, we should get rid of all plugins and only use one implementation (that works well). The "internal" plugin is supposed to be(come) that. That also means, that we are not going to add more (external) DHCP plugins and we are not going to invest work in the existing plugins (except the "internal" plugin). Some DHCP plugins are known to not support IPv6. If the user selects "dhcpcd" we should just fallback to the "internal" plugin. What's the point of letting the activation fail? Probably users shouldn't use "dhcpcd" plugin anyway, but that's a different story. Doing such fallback could be a problem with forward compatibility if we ever would add IPv6 support to "dhcpcd". But we won't. Also, we are going to add "n-dhcp4" as replacement for the systemd based code. For a time, there will be an experimental plugin "nettools" that eventually will become the new "internal" plugin. Until that happens, we want for IPv6 automatically fallback to systemd based "internal" plugin. This patch will make that simple. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/173
* libnm/tests: fix team tests with "--enable-json-validation=no"Thomas Haller2019-06-111-1/+1
|
* NEWS: updateThomas Haller2019-06-111-0/+3
|
* libnm/team: fix setting setting same JSON stringThomas Haller2019-06-091-5/+8
| | | | | | | | | | | When we set the same JSON config twice in a row, the second time has indeed no effect and we can just return right away (indicating that no attributes changed). However, that is not true, if we are in strict validating mode and the JSON string just happens to be the same. In this case, we still want to switch from strict validating mode to relaxed mode. Hence, we should not return early but continue setting the property.
* wwan: don't call _nm_modem_set_operator_code() in property setterThomas Haller2019-06-091-1/+2
| | | | | | | | | | | | | | | | | NM_MODEM_OPERATOR_CODE property is construct-only. Add our common code comment to the property setter. Construct-only setters are pretty simple. They run before the object is constructed, hence their scope is clearer. As such, there is no need to emit property changed notifications (also because that is already taken care by the GObject property setter). Don't call _nm_modem_set_operator_code(), just directly set the property. Usually we aim to have only one place where we set state (_nm_modem_set_operator_code()). But a construct-only property setter is trivial enough that we can affort having two places to modify the property. In particular, because the property setter does not "modify" the property, it merely initializes it before the object is fully constructed.
* wwan: remove unused property setter for NM_MODEM_APNThomas Haller2019-06-091-3/+0
| | | | The property is read-only. The setter code is unused and unnecessary.
* merge: branch 'lr/modem-properties'Lubomir Rintel2019-06-0510-14/+378
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/139
| * libnm/modem: add APN getterlr/modem-propertiesLubomir Rintel2019-06-053-0/+41
| |
| * wwan: expose the APN on the D-BusLubomir Rintel2019-06-057-0/+80
| | | | | | | | | | This is going to be useful for UIs to know which plan we're actually using.
| * libnm/modem: add network id getterLubomir Rintel2019-06-053-0/+42
| |
| * wwan: expose the network id on the D-BusLubomir Rintel2019-06-057-1/+106
| | | | | | | | | | This is going to be useful for UIs to find out which network is the device actually registered with.
| * libnm/modem: add device id getterLubomir Rintel2019-06-053-0/+59
| |
| * wwan: expose device id on the busLubomir Rintel2019-06-054-1/+33
| | | | | | | | | | | | The device id is useful to pinpoint the connection to a particular device. However, we don't expose it anywhere and it's sort of hard to guess.
| * introspection/modem: (trivial) move a signal below propertiesLubomir Rintel2019-06-051-11/+11
| |
| * devices/modem-broadband: disconnect signals on disposeLubomir Rintel2019-06-051-1/+6
|/
* ethernet: don't set a hw address in a default connectionLubomir Rintel2019-06-051-8/+4
| | | | | | | | | Use an ifname instead. This also fixes creation of default wired connections for cheapo USB ethernet adapters that come with the EEPROM footprint unpopulated. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/137/
* device: fix matching parent device by connection UUIDBeniamino Galvani2019-06-051-5/+3
| | | | | | | | | | | We must compare the UUID with the one on the *parent* device. Also, simplify the checks to only return TRUE at the end of function. Fixes: 27c281ac5a5c ('device: deduplicate match_parent()') https://bugzilla.redhat.com/show_bug.cgi?id=1716438 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/176
* release: bump version to 1.19.3-dev1.19.3-devLubomir Rintel2019-06-042-2/+2
|
* team: merge branch 'th/team-fix'Beniamino Galvani2019-06-047-672/+878
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/169
| * libnm/team: strict validate team settings by libnm clients not sending the JSONThomas Haller2019-06-043-31/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * cli: remove unnecessary workaround for clearing team link watchers and ↵Thomas Haller2019-06-041-82/+0
| | | | | | | | | | | | | | | | | | | | 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.
| * libnm/team: fix handling default values and stricter validate team configThomas Haller2019-06-047-551/+817
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * libnm/team: reorder fields in JSON output for team link watcherThomas Haller2019-06-042-14/+14
| | | | | | | | | | | | | | | | | | The order of the fields in the JSON object does not really matter. Note that with the recent rework the order changed. Before it was arbitrarily, now it still is arbitrary. Reorder again, to follow the same order as `man teamd.conf`.
| * libnm/team: add space in JSON output for link watcherThomas Haller2019-06-042-4/+4
|/ | | | | | | | | | Generate the following: { "runner": { "sys_prio": 10 }, "link_watch": { "name": "ethtool" } } instead of: { "runner": { "sys_prio": 10 }, "link_watch": { "name": "ethtool"} }
* build/meson: depend test-dispatcher-envp on libnmThomas Haller2019-06-021-1/+4
| | | | | | Otherwise we can get a build failiure: ../libnm/NetworkManager.h:61:27: fatal error: nm-enum-types.h: No such file or directory
* cli: fix resetting default value for GObject propertyThomas Haller2019-05-311-1/+1
| | | | | | | | | 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: 3c82db710f50 ('cli: reset default value of properties via set_fcn()')
* config: also save next-server in the state fileLubomir Rintel2019-05-303-2/+16
| | | | | | | | | The early boot tooling gets the root-path from our state file due to a lack of a better way to do that. However, when booting with NFS root, the root path alone is not sufficient; the server address is communicated via the next-server option. Save that one in the state file as well. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/168
* dhcp/trivial: add fixme comment about stopping clientsThomas Haller2019-05-291-0/+6
|
* cli: enforce int type in for loopsFrancesco Giudici2019-05-291-15/+15
|
* gitlab-ci: merge branch 'th/gitlab-ci-centos'Thomas Haller2019-05-299-35/+65
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/170
| * gitlab-ci: also build on CentOS 7.5 and 7.6th/gitlab-ci-centosThomas Haller2019-05-293-9/+33
| |
| * gitlab-ci: run "checkpatch" test on Fedora 29 imageThomas Haller2019-05-291-1/+1
| | | | | | | | | | Fedora 28 is no longer supported at this point. Run the "checkpatch" test on a Fedora 29 image instead.
| * build: disable "-Wunknown-pragmas" warningThomas Haller2019-05-292-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang on CentOS 7.6 (3.4.2-9.el7) warns: CC clients/tui/newt/clients_tui_newt_libnmt_newt_a-nmt-newt-button.o In file included from ../clients/tui/newt/nmt-newt-button.c:26: In file included from ../shared/nm-default.h:280: ../shared/nm-glib-aux/nm-macros-internal.h:1617:2: error: unknown warning group -Wstringop-truncation, ignored [-Werror,-Wunknown-pragmas] NM_PRAGMA_WARNING_DISABLE ("-Wstringop-truncation"); ^ ../shared/nm-glib-aux/nm-macros-internal.h:419:9: note: expanded from macro NM_PRAGMA_WARNING_DISABLE _Pragma(_NM_PRAGMA_WARNING_DO(warning)) ^ <scratch space>:109:25: note: expanded from here GCC diagnostic ignored "-Wstringop-truncation" ^ This warning totally defeats the purpose of why we use the pragma in the first place.
| * clients/tests: increase timeout waiting for stub D-Bus serviceThomas Haller2019-05-291-1/+1
| | | | | | | | | | | | 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.
| * platform: avoid compiler error passing NMP_OBJECT_CAST_OBJ_WITH_IFINDEX() to ↵Thomas Haller2019-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | nm_hash_update_vals() Clang (3.4.2-9.el7) on CentOS 7.6 fails related to nm_hash_update_vals(). Clang seems to dislike passing certain complex arguments to typeof(). I'd prefer to fix nm_hash_update_vals() to not have this problem, but I don't know how. This works around the issue.
| * platform: make nm_platform_kernel_support_get() macro an inline functionThomas Haller2019-05-291-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang (3.4.2-9.el7) on CentOS 7.6 fails related to nm_hash_update_vals(). I am not even quoting the error message, it's totally non-understandable. nm_hash_update_vals() uses typeof(), and in some obscure cases, clang dislikes when the argument itself is some complex macro. I didn't fully understand why, but this works around it. I would prefer to fix nm_hash_update_vals() to not have this limitation. But I don't know how. There is probably no downside to have this an inline function instead of a macro.