Commit Graph

18815 Commits

Author SHA1 Message Date
Thomas Haller
1433682c28 device: inline NMDevice's implementation of can_auto_connect()
Derived classes should not modify or overwrite this essential behavior
of can_auto_connect(). It doesn't belong to the virtual function.

(cherry picked from commit 715aebe08a)
2017-11-08 12:35:10 +01:00
Thomas Haller
d8bb62c909 policy: remove redundant check in device_autoconnect_changed()
schedule_activate_check() also checks for nm_device_autoconnect_allowed()
and aborts if there is nothing to do.

(cherry picked from commit 990af413ac)
2017-11-08 12:35:10 +01:00
Thomas Haller
d0f82352ea device: move nm_device_get_enabled() from schedule_activate_check() to nm_device_autoconnect_allowed()
(cherry picked from commit fc18ff30cf)
2017-11-08 12:35:09 +01:00
Thomas Haller
b49c6fb98a device: drop stub implementation of get_autoconnect_allowed() in NMDevice
(cherry picked from commit 9a7e668dbb)
2017-11-08 12:35:09 +01:00
Josef Andersson
1729255940 po: update Swedish (sv) translation (bgo #790018)
Reviewed-by: Anders Jonsson <anders.jonsson@norsjovallen.se>

https://bugzilla.gnome.org/show_bug.cgi?id=790018
(cherry picked from commit 80687ed0ce)
2017-11-07 19:27:29 +01:00
Beniamino Galvani
293710434d ifcfg-rh: persist the connection type for TeamPort connections
Currently the ifcfg-rh plugin doesn't explicitly store the connection
type for team slaves and is only able to read back ethernet and vlan
connections.

Leave this unchanged for ethernet and vlan slaves, but store the TYPE
variable for other connection types (Wi-Fi and Infiniband) so that we
can properly determine their type when the connection is read.

(cherry picked from commit 29a576496e)
2017-11-06 16:46:22 +01:00
Piotr Drąg
e8a7d1500a po: update Polish (pl) translation (bgo #789874)
https://bugzilla.gnome.org/show_bug.cgi?id=789874
(cherry picked from commit b7b052c41e)
2017-11-06 12:29:24 +01:00
Thomas Haller
e2e4cdd2c1 doc: fix type on documentation for NMSettingOvsPort:bond-updelay
Fixes: 8a1ae40a80

https://bugzilla.gnome.org/show_bug.cgi?id=789880
(cherry picked from commit 5986d92053)
2017-11-06 12:27:21 +01:00
Thomas Haller
45fc95f051 logging: configure dnsmasq's logging in shared mode via nm-logging
(cherry picked from commit cc993aa020)
2017-11-06 12:25:23 +01:00
Thomas Haller
90d8e26159 man: document PROXY logging domain
(cherry picked from commit 43da186ec3)
2017-11-06 12:25:23 +01:00
Beniamino Galvani
de6b348bfc release: bump version to 1.9.90 (1.10-rc1) 2017-11-03 15:46:53 +01:00
Beniamino Galvani
affeeb5a23 NEWS: update for a release candidate 2017-11-03 15:46:02 +01:00
Beniamino Galvani
db41380c15 ndisc: fix ordering of gateways
Insert the new gateway at the end when it has the least preference.

Fixes the following runtime error:
 src/ndisc/nm-ndisc.c:204:_ASSERT_data_gateways: assertion failed:
 (_preference_to_priority (item_prev->preference) >=
 _preference_to_priority (item->preference))
2017-11-03 10:44:48 +01:00
Beniamino Galvani
4a9ec4d39b clients: merge branch 'bg/cli-agent-race-rh1438476'
https://bugzilla.redhat.com/show_bug.cgi?id=1438476
2017-11-02 15:26:07 +01:00
Beniamino Galvani
61b666902b cli: enable secret-agent only after activation
Change the activation procedure for connections that require secrets
in the following way:

 - nmcli creates a secret-agent and leaves it disabled so that
   incoming requests are queued
 - nmcli calls ActivateConnection()
 - when the method returns success, the secret-agent gets enabled and
   all queued requests are processed

When the user activates a connection which is already auto-activating,
NM will deactivate the current active-connection and will call
CancelGetSecrets() for it before the new ActivateConnection()
returns. In this way, when the secret-agent is enabled by nmcli, we
have the guarantee that there aren't any queued requests for
the deactivating connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1438476
2017-11-02 15:25:59 +01:00
Beniamino Galvani
a25db64f7c clients: implement CancelGetSecrets() secret-agent API 2017-11-02 15:25:59 +01:00
Thomas Haller
28b97f02f6 systemd: let "NetworkManager-wait-online.service" require "NetworkManager.service"
`systemctl start network-online.target` should suffice to start
"NetworkManager.service".

That would work because
 - "network-online.target" has "Wants=NetworkManager-wait-online.service"
 - "NetworkManager-wait-online.service" has "Require=NetworkManager.service".

But previously, "NetworkManager-wait-online.service" would just
fail with missing dependency.

See also https://github.com/systemd/systemd/pull/6065 which does the
same for networkd's wait-online serice, and see rh#1452866 for a
use-case.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1452866
2017-11-02 15:21:42 +01:00
Beniamino Galvani
efe815737b contrib/rpm: fix builds without ovs support
Don't compile ovs support when the RPM is built --without=ovs, to fix
the following error:

error: Installed (but unpackaged) file(s) found:
   /usr/lib/systemd/system/NetworkManager.service.d/NetworkManager-ovs.conf
   /usr/lib64/NetworkManager/libnm-device-plugin-ovs.so
   /usr/share/man/man7/nm-openvswitch.7.gz

Fixes: 830a5a14cb
2017-11-02 11:54:18 +01:00
Thomas Haller
eed8ea458b all: merge branch 'th/autoconnect-rh1401515-2'
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1401515
2017-11-02 11:42:57 +01:00
Thomas Haller
72756994d4 wifi: use connection.auth-retries to handle authentication in NMDeviceWifi 2017-11-02 11:41:01 +01:00
Thomas Haller
32acaccf2a device: move tracking auth_retry to NMDevice
It will be also used by NMDeviceWifi. It might waste a 4 bytes for device types
that don't require authentication. But it deduplicates code.
2017-11-02 11:41:01 +01:00
Thomas Haller
6705c71263 ifcfg-rh: use svSetValueInt64_cond() in write_connection_setting() 2017-11-02 11:41:01 +01:00
Thomas Haller
2730dc60de all: move setting 802-1x.auth-retries to connection.auth-retries
The number of authentication retires is useful also for passwords aside
802-1x settings. For example, src/devices/wifi/nm-device-wifi.c also has
a retry counter and uses a hard-coded value of 3.

Move the setting, so that it can be used in general. Although it is still
not implemented for other settings.

This is an API and ABI break.
2017-11-02 11:41:01 +01:00
Lubomir Rintel
c81005b846 libnm/client: proxy *_enabled and metered properties to the right object
They're provided by the Manager, not by the RemoteSettings.
2017-11-02 09:04:42 +01:00
Thomas Haller
53dea38834 ifcfg-rh: refactor write_object() to avoid coverity warning
Coverity detects that the "if (blob)" condition must always be true.
Reorder the code, to avoid the warning. It's a bit clearer this way
anyway.
2017-10-31 20:15:04 +01:00
Thomas Haller
76b913a210 ovs: add backward compatibility wrapper for json_object_foreach() macro 2017-10-31 20:02:48 +01:00
Thomas Haller
b84f63265f core: merge branch 'th/autoconnect-rh1401515' (part 1)
Some cleanup of handling autoconnect behavior.

The introduction of NMSetting8021x:auth-retries property,
changes behavior in that password retries are no longer
controlled by NMSettingConnection:autoconnect-retries property.

https://bugzilla.redhat.com/show_bug.cgi?id=1401515
2017-10-31 19:44:03 +01:00
Thomas Haller
cb2aa6bd4c policy: move blocking autoconnect from NMDeviceModem to NMPolicy
Only NMPolicy should be concerned with handling autoconnect, and
blocking it.

Move the code. Note that there is a slight possible change in
behavior, as the order of when the connection is blocked changes,
based on the different times when the device changed signal gets
executed. But that shouldn't be a problem.
2017-10-31 19:35:33 +01:00
Thomas Haller
3828ba3b0e policy: inline can_autoconnect check in auto_activate_device() 2017-10-31 19:35:33 +01:00
Thomas Haller
1a9d4869ed policy: move nm_settings_connection_can_autoconnect() to policy
Step by step, we move all tracking of autoconnect to NMPolicy.
2017-10-31 19:35:33 +01:00
Thomas Haller
e62e52dfe1 device: handle authentication retries using 802-1x.auth-retries setting
Since commit 4a6fd0e83e (device: honor the
connection.autoconnect-retries for 802.1X) and the related bug bgo#723084,
we reuse the autoconnect-retries setting to control the retry count
for requesting passwords.

I think that is wrong. These are two different settings, we should not
reuse the autoconnect retry counter while the device is still active.

For example, the user might wish to set autoconnect-retries to infinity
(zero). In that case, we would retry indefinitly to request a password.
That could be problematic, if there is a different issue with the
connection, that makes it appear tha the password is wrong.
A full re-activation might succeed, but we would never stop retrying
to authenticate. Instead, we should have two different settings for
retrying to authenticate and to autoconnect.

This is a change in behavior compared to 1.8.
2017-10-31 19:35:33 +01:00
Thomas Haller
89e518db5a libnm,cli,ifcfg-rh: add NMSetting8021x:auth-retries property 2017-10-31 19:35:33 +01:00
Thomas Haller
ef60cf890f docs: clearify documentation of connection.autoconnect-retries 2017-10-31 19:35:33 +01:00
Thomas Haller
18f2d272ba settings: add and use nm_settings_connection_autoconnect_retries_try_next() 2017-10-31 19:35:33 +01:00
Thomas Haller
361a199a06 device: move resetting autoconnect retries from subtype to NMDevice 2017-10-31 19:35:28 +01:00
Thomas Haller
447dc874ce config: remove nm_config_data_get_value_cached()
It has almost no callers, and it is a bit of a strange API. Let's
not cache the last accessed value inside NMConfigData. Instead, free
it right after use. It was not reused anyway, it only hangs around
as convenience for the caller.
2017-10-31 19:14:07 +01:00
Thomas Haller
262159be00 config: add nm_config_data_get_value_int64() util 2017-10-31 19:14:07 +01:00
Thomas Haller
ec9bff293b settings/trivial: rename settings-connection's autoconnect functions
Names like
  - nm_settings_connection_get_autoconnect_retries
  - nm_settings_connection_set_autoconnect_retries
  - nm_settings_connection_reset_autoconnect_retries
are about the same thing, but they are cumbersome to grep
because they share not a common prefix.

Rename them from SUBJECT_VERB_OBJECT to SUBJECT_OBJECT_VERB,
which sounds odd in English, but seems preferred to me.
Now you can grep for "nm_settings_connection_autoconnect_retries_" to
get all accessors of the retry count, or "nm_settings_connection_autoconnect_"
to get all accessors related to autoconnect in general.
2017-10-31 19:14:07 +01:00
Lubomir Rintel
f0a23bf999 Revert "device: log device type too"
I didn't really mean to include it as it doesn't make any sense at this
point and makes the logs a bit more messy.

This reverts commit 340e35c09d.
2017-10-31 18:48:41 +01:00
Lubomir Rintel
bc83bec253 device: avoid touching sysctls for devices without platform link
Since 32b3eb1181 [core: merge IPv4 and IPv6 implementation of
nm_utils_ip4_property_path()], nm_utils_sysctl_ip_conf_path() introduced
in cd271d5cb1 [core: add nm_utils_sysctl_ip_conf_is_path() util] is used to
cunstruct sysctl paths and it is way less tolerant towards using something
that is not an interface name in the path.

It's always been incorrect to assume the ifname is a linux link name and
it resulted it ugly, if benign, sysctl access attempts such as
"/sys/class/net/28:B2:BD:5D:23:AB/phys_port_id" etc.

Now it triggers an assertion failure. Let's guard all such accesses.

Fixes: 32b3eb1181
Fixes: cd271d5cb1
2017-10-31 18:46:17 +01:00
Beniamino Galvani
5f97430e21 ifcfg-rh: remove password-raw keys file after test
Fixes: a83ab252ee
2017-10-31 14:44:39 +01:00
Lubomir Rintel
47ebb98630 devices/ovs/ovsdb: fix 32bit builds
So that we work well on VAXen.
2017-10-31 10:57:05 +01:00
Beniamino Galvani
a83ab252ee ifcfg-rh: add support for 802-1x.password-raw property
When the ifcfg-rh plugin writes a 802-1x setting it currently ignores
the password-raw property and so the password disappears when the
connection is saved. Add support for the property.
2017-10-31 10:19:49 +01:00
Lubomir Rintel
eee1553288 devices/ovs/ovsdb: fix build with old Jansson 2017-10-31 09:21:30 +01:00
Lubomir Rintel
b23f8ceb34 build: always include data/NetworkManager-ovs.conf in dist 2017-10-31 09:11:54 +01:00
Thomas Haller
d7d9759d56 docs: fix typo in NMSettingBridge:group-forward-mask doc
Fixes: 17ec3aef2f

https://bugzilla.gnome.org/show_bug.cgi?id=789662
2017-10-30 21:49:50 +01:00
Lubomir Rintel
79168a5434 merge: branch 'lr/ovs'
https://bugzilla.redhat.com/show_bug.cgi?id=1470282
2017-10-30 21:48:22 +01:00
Lubomir Rintel
6b532fed50 man: add OpenVSwitch overview 2017-10-30 21:46:55 +01:00
Thomas Haller
4199c976da libnm: fix normalizing and verifying OVS connections
Normalizing can be complicated, as settings depend on each other and possibly
conflict.

That is, because verify() must exactly anticipate whether normalization will
succeed and how the result will look like. That is because we only want to
modify the connection, if we are sure that the result will verify.

Hence, verify() and normalize() are strongly related. The implementation
should not be spread out between NMSettingOvsInterface:verify(),
NMSettingOvsPatch:verify() and _normalize_ovs_interface_type().

Also, add some unit-tests.
2017-10-30 21:46:55 +01:00
Thomas Haller
93315d01da tests: add nmtst_assert_connection_has_settings() helper 2017-10-30 21:46:55 +01:00