Commit graph

24356 commits

Author SHA1 Message Date
Beniamino Galvani
551fd3e28f libnm: adjust symbol versioning after backporting 802-1x.optional to 1.20.6
NM 1.22 is not released yet and 1.20.6 will happen before 1.22.0, so
we can introduce the new API with version libnm_1_20_6 in both
releases without having duplicate symbols on 1.22.
2019-11-06 13:39:54 +01:00
Lubomir Rintel
c820c98f2a clients: draw border around qr code on linux console
Scanners won't recognize it on black background otherwise.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/327
2019-11-05 16:32:20 +01:00
Lubomir Rintel
8eb20013ab merge: branch 'sharkcz/s390-initrd'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/317
2019-11-04 16:22:54 +01:00
Lubomir Rintel
927ae6d927 initrd/tests: test that we generate the s390 interface names correctly 2019-11-04 16:22:14 +01:00
Dan Horák
22e388d90e initrd: handle rd.znet with legacy interface names
Handle rd.znet with legacy interface names too, the index for eth or ctc
corresponds to the position on the command line.
2019-11-04 16:22:14 +01:00
Dan Horák
c7423dca89 initrd: prepare interface in rd.znet only if persistent interface names are enabled
When processing the rd.znet option set the interface name only in case when
the persistent interface names feature isn't disabled via net.ifnames=0

[lkundrak@v3.sk: minor tweaks to the net.ifnames=0 parsing]
2019-11-04 16:21:58 +01:00
Dan Horák
c27f5030e9 initrd/tests: use a valid combination of device and interface name for testing 2019-11-04 16:21:16 +01:00
Dan Horák
adcc52c3da initrd: use proper interface when adding s390 specific details
The current solution for s390 specific details relies on an interface to
exist before adding the s390 details. It means the ip= option must precede
the rd.znet= option. Also only a single interface can be configured. With
this change the s390 details are put to the right interface and properly
named interface is created if it hasn't existed yet.
2019-11-04 15:44:58 +01:00
Lubomir Rintel
4e34807a8c release: bump version to 1.21.3-dev 2019-11-03 09:01:30 +01:00
Lubomir Rintel
c2ec79217a merge: branch 'lr/fix-iwd-1-0'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/325
2019-11-03 08:54:56 +01:00
Lubomir Rintel
186d22a963 iwd: unbreak iwd-1.0
The upstream apparently thought it's a great idea to change the agent
manager path. This fixes things for those unfortunate enough to run
IWD.
2019-11-03 07:51:24 +01:00
Lubomir Rintel
59923ad85d iwd: add some missing error handling
g_dbus_object_manager_get_interface() can happily return NULL and we
need to check for that.
2019-11-02 07:02:59 +01:00
worldofpeace
e1ead6fa98 build: add PPPD_PATH to config.h.meson
Without this using -Dpppd= was completely broken.

First observed in NixOS [0]

[0]: https://github.com/NixOS/nixpkgs/issues/72330

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/323
2019-11-01 07:25:26 +01:00
Lubomir Rintel
9242b5ebc1 po/de: fix quoting 2019-10-31 07:23:24 +01:00
Lubomir Rintel
e63b2afe7c clients/cli: give some hints to the translators 2019-10-30 17:15:14 +01:00
Thomas Haller
4340f6111a po: merge branch with translation fixes for German
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/320
2019-10-30 16:55:02 +01:00
maxbachmann
777ccb79a4 fix translation 2019-10-30 16:54:41 +01:00
maxbachmann
5535dcf51b po/de: fix some spelling mistakes
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/320
2019-10-30 14:54:08 +01:00
Lubomir Rintel
35e4e106cb merge: branch 'lr/hotspot-reuse'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/305
2019-10-30 14:32:46 +01:00
Lubomir Rintel
9c5ea0917d devices: reuse the hotspot connection if we find appropriate one
Otherwise repeated "nmcli d wifi hotspot" commands create multiple
Hostpot connections, which is just sad. We do already reuse existing
connections with "nmcli d wifi connect" -- let's just do a similar thing
here.
2019-10-30 14:29:38 +01:00
Lubomir Rintel
9f5711bec4 cli: split off the update or add-and-activate logic 2019-10-30 14:08:57 +01:00
Thomas Haller
074e5503d7 libnm: merge branch 'th/libnm-various-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/319
2019-10-27 14:31:05 +01:00
Thomas Haller
0dfabef46e libnm: add and use _nml_coerce_property_*()
Our NMObject implementations should behave in a similar manner.
For example, string properties should be coerced the a consistent
manner.

Add functions _nml_coerce_property_*() for that. Of course, they
are trivial. Their value is not that they encapsulate some complex
implementation, but that they convey a general concept of how we
want to handle certain properties in NMClient's object cache.
2019-10-27 14:30:51 +01:00
Thomas Haller
8c7da62f9b libnm: add NM_CLIENT_CHECKPOINTS define 2019-10-27 14:30:51 +01:00
Thomas Haller
57d94e792f libnm: don't emit g_warning() from nm_utils_ip6_dns_from_variant()
The library should not print to stdout/stderr. This function is used to
convert untrusted(!!) input to a normalized and sanitized strv array.
g_warning() is essentially an assertion, and it's wrong to do that
for untrusted data. If the caller had to pre-validate the array, then
having this function would be pointless.
2019-10-27 14:30:51 +01:00
Thomas Haller
1cf4de20eb libnm: add comment about not-implement property NMDeviceVxlan:carrier
The server does not expose this property on D-Bus. It's always FALSE.
Add a comment about that.
2019-10-27 14:30:51 +01:00
Thomas Haller
6a0062e4ff libnm: add comment about not-implement property NMDeviceMacvlan:hw-address
The server does not expose this property on D-Bus. It's always NULL.
Add a comment about that.
2019-10-27 14:30:51 +01:00
Thomas Haller
3ed514cb60 libnm: change default value for NMClient:{networking,wireless-hardware}-enabled properties 2019-10-27 14:30:51 +01:00
Thomas Haller
91f3311e71 libnm: change default value for NMClient:dns-{mode,rc-manager} properties 2019-10-27 14:30:51 +01:00
Thomas Haller
c1ee10c4d9 libnm: change default value for NMDevice:mtu property
Default values should preferably be zero and/or a value that indicates
that the property is unknown/unset.

In practice, this property is not unset because it's present
on the D-Bus API.
2019-10-27 14:30:51 +01:00
Thomas Haller
b59954e355 libnm: change default value for NMDevice:autoconnect property
Yes, by default (server side) devices do autoconnect.
But that does not mean an NMObject, that has its GObject property
not set via D-Bus shall default to TRUE.

Default values preferably should be FALSE, because that is what we get
by default (memset(0)).
2019-10-27 14:30:51 +01:00
Thomas Haller
3f476b7a50 libnm: change default value for NMAccessPoint:mode property
NMAccessPoint is an NMObject, and exclusively created and initialized by
NMClient. In practice, the D-Bus property is always present on D-Bus, so
the default value is not used. However, a better default is anyway
"unknown", also because that has zero numeric value.
2019-10-27 14:30:51 +01:00
Thomas Haller
1c4acc89f1 shared: add NM_IS_REF_STRING() helper 2019-10-27 14:30:51 +01:00
Thomas Haller
a75dccad78 shared: add @deep_copied argument to nm_utils_strv_dup() 2019-10-27 14:30:51 +01:00
Thomas Haller
0bff8d7710 contrib: fix detection of whether being sourced in NM-log script 2019-10-26 14:22:44 +02:00
Beniamino Galvani
487b5df716 core: merge branch 'bg/prefix-route'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/312
https://bugzilla.redhat.com/show_bug.cgi?id=1700415
2019-10-24 11:19:18 +02:00
Beniamino Galvani
d6ee22d198 core: don't add prefix route for /32 addresses without peer
Kernel doesn't do it either, see function fib_add_ifaddr().
2019-10-23 21:52:48 +02:00
Beniamino Galvani
ea1679aac0 core: don't add prefix route for external addresses
If the user adds an address manually, kernel automatically adds a
prefix route for it unless the address has the NOPREFIXROUTE
flag. When ip_config_merge_and_apply() gets called, NM also adds its
prefix route and so we end up with two routes that differ only for the
metric.

This is a problem because the route added by NM is not removed if the
user removes the previously added address. Also, it seems confusing to
have multiple instances of the same routes.

This commit skips the addition of a prefix route for addresses added
manually outside of NetworkManager.
2019-10-23 21:46:26 +02:00
Beniamino Galvani
3eb2f435ae core: track whether IP addresses are external
Track whether IP addresses were added by NM or externally. In this way
it becomes possible in a later commit to add prefix route only for
addresses added by NM.
2019-10-23 17:44:38 +02:00
Beniamino Galvani
01920d3d52 device: allow reapply when the device is activating
Allow a reapply of the connection when the device is still activating
and ensure that each reapply action is performed only at a given
activation stage. For example, the IP configuration is not reactivated
if the device is in the prepare stage.

https://bugzilla.redhat.com/show_bug.cgi?id=1763062
2019-10-23 16:09:56 +02:00
Thomas Haller
dab1d780fd libnm: retire deprecated WiMAX NMObject types
WiMAX is deprecated since NetworkManager 1.2.0. Note that also
NetworkManager on server side no longer supports this type, hence
the server's D-Bus API will never expose devices of this type.

Note that NMDeviceWimax and NMWimaxNsp are NMObject types. That means,
they are instantiated by NMClient to represent information on the D-Bus
interface. As NetworkManager no longer exposes WiMAX devices, such
devices are never created. Note that it makes no sense that a user would
directly instantiate NMObject types, because they only work together with
NMClient.

Don't drop the related symbols and definitions from libnm, so that there
is no API/ABI change (as far as building and linking is concerned). But
make the types defunctional (which of course is a behavioral API change).
Calling the API now triggers a g_return_*() warning.

Also belatedly mark the WimaxNsp API as deprecated. It should have been
done in 1.2. Note that here we deprecate the API and retire it at the
same time. Optimally, we would have deprecated it a few releases ago,
before retiring it. However, marking something for deprecation is anyway
no excuse for anything. I mean, removing or retiring API is usually
painful, regardless whether it was marked for deprecation or not. In this
case, there is no possibility that a libnm user gets hold on a NMDeviceWimax
or NMWimaxNsp instance, because NMClient simply no longer instantiates
them. Hence, this change should not affect any user in practice.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/316
2019-10-23 15:31:51 +02:00
Thomas Haller
e346bdc550 device/wwan: merge branch 'afaure/protect-self-variable'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/303
2019-10-23 15:27:24 +02:00
Thomas Haller
ae21d851e8 device/wwan: fix leak of "error" variable in connect_ready()
Fixes: 105ee6e5a9 ('device: fix crash by handling connection cancellation')
2019-10-23 15:25:46 +02:00
Antoine Faure
105ee6e5a9 device: fix crash by handling connection cancellation 2019-10-23 15:23:52 +02:00
Thomas Haller
7efc3c479f dhcp: truncate client-id for n-dhcp4 client at arbitrary limit
RFC does not define how long the client ID can be. However,
n-dhcp4 enforces that the server replies with a client ID that
matches the request. Also, the client ID gets encoded as a DHCP
option, hence it cannot be longer than 255 bytes.

While n-dhcp4 doesn't enforce a certain length, a too long client
ID is not going to work. Hence, truncate it at 133 bytes.

This is the same limit that also systemd's DHCP client has. It's chosen
to fit an RFC4361-complient client ID with a DUID of length
MAX_DUID_LEN (which is 128 bytes according to RFC 3315 section 9.1).

Fixes-test: @ipv4_set_very_long_dhcp_client_id

See-also: https://github.com/nettools/n-dhcp4/pull/6

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/307
2019-10-23 14:58:13 +02:00
Thomas Haller
907bd28203 po/da: merge branch 'scootergrisen:patch-2' (#313)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/313
2019-10-23 13:53:36 +02:00
scootergrisen
fa8dc1c314 Fix missing \n 2019-10-23 05:07:14 +00:00
scootergrisen
03f51ef671 Update da.po 2019-10-23 03:20:00 +00:00
Thomas Haller
f2d3f29c73 libnm: merge branch 'th/libnm-hide-gobject-structs'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/314
2019-10-22 10:59:49 +02:00
Thomas Haller
57aa5e2a9d libnm: hide GObject structs from public API and embed private data
These types are all subclasses of NMObject. These instances are commonly
created by NMClient itself. It makes no sense that a user would
instantiate the type. Much less does it make sense to subclass them.

Hide the object and class structures from public API.

This is an API and ABI break, but of something that is very likely
unused.

This is mainly done to embed the private structure in the object itself.
This has benefits for performance and debugability. But most
importantly, we can obtain a static offset where to access the private data.
That means, we can use the information to access the data pointer
generically, as we will need later.

This is not done for the internal types NMManager, NMRemoteSettings,
and NMDnsManager. These types will be dropped later.
2019-10-22 10:58:52 +02:00