Commit Graph

24524 Commits

Author SHA1 Message Date
Thomas Haller
abb68d90fc libnm: retire nm_client_wimax_*() functions
The server doesn's support WiMAX anymore. Hence there is no point in keeping
this functionality. While we cannot drop the functions, let them not do anything.

The code in NMManager is still there. But since we will soon drop
NMManager entirely, it doesn't matter.
2019-11-07 11:34:36 +01:00
Thomas Haller
2e91add7e4 libnm: move nm_permission_to_client()/nm_permission_result_to_client() to nm-libnm-utils.c
It's nicely trivial and independent. Move it to a separate place,
to avoid cluttering the more complicated code and to make it testable.

Also, use binary search to find the value by string.
2019-11-07 11:34:36 +01:00
Thomas Haller
83d7599acc libnm: deprecate nm_device_set_managed() and nm_device_set_autoconnect() API
These setters not only invoke a synchronous D-Bus call (ignoring the
return value). They also modify the content of the cache client-side,
bypassing the information that we receive via notifications from the
server.

Also, they don't emit property changed signals, but in any case they
are broken beyond repair.

Fully mark them as deprecated. Note that they were already marked as
_NM_DEPRECATED_SYNC_METHOD. However, that does not actually mark
the API as deprecated, because fully deprecating all synchronous
methods is premature at this point.
2019-11-07 11:34:36 +01:00
Thomas Haller
9c01d6ca67 libnm: print timestamp in LIBNM_CLIENT_DEBUG debug logging
It's useful, because it's easy to get overwhelemed by the logging output.
The timestamp makes it easier to keep track. Also, it allows to see how long
things take.
2019-11-07 11:34:36 +01:00
Thomas Haller
1463450393 all: use nm_dbus_path_not_empty() 2019-11-07 11:34:36 +01:00
Thomas Haller
88ef02ec33 shared/tests: add nmtst_main_context_iterate_until() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
afa54fdfd5 shared: add nm_g_main_context_push_thread_default*() and nm_auto helper 2019-11-07 11:34:36 +01:00
Thomas Haller
3b95905ae3 shared: add nm_auto_destroy_and_unref_gsource macro 2019-11-07 11:34:36 +01:00
Thomas Haller
01335ecec6 shared: assert in nm_ref_string_unref() for valid NMRefString instance 2019-11-07 11:34:36 +01:00
Thomas Haller
15fe8ad851 shared: add nm_dbus_path_not_empty() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
9b2d5742c1 shared: add nm_g_set_error_take*() util 2019-11-07 11:34:36 +01:00
Thomas Haller
d21439eaa0 shared: add nm_ppdirect_hash()/nm_ppdirect_equal() helpers
Useful for hashing pointers to a pointer to a pointer, and
compare the resulting pointer directly. This will be actually
used.
2019-11-07 11:34:36 +01:00
Thomas Haller
86352ceaf8 shared: add NM_STRUCT_OFFSET_ENSURE_TYPE() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
4a870c57f5 nmcli/tests: fix broken test after "nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'"
Fixes: 303fc17450 ('nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'')
2019-11-07 09:36:11 +01:00
Antonio Cardace
303fc17450 nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/218

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/322
2019-11-06 21:08:23 +01:00
Thomas Haller
e2dac63de6 libnm: fix handling "q" (uint16) property types in libnm
NMDeviceVxlan has some "q" type properties. They were not handled:

    $ G_MESSAGES_DEBUG=all PAGER= LIBNM_GLIB_DEBUG=properties-changed nmcli 2>&1 | grep "couldn't be set from D-Bus type"
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:dst-port (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:src-port-max (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:src-port-min (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.539: demarshal_generic: NMDeviceWireGuard:listen-port (type guint) couldn't be set from D-Bus type q.
2019-11-06 17:30:25 +01:00
Thomas Haller
ea8546b622 libnm/license: relicense "libnm-core/nm-json.[hc]" under LGPL-2.1+
The only contributors to this code are Red Hat employees who agree
with this license change.

  $ git log --pretty=format:'%Cred%h%Creset - %Cgreen(%ai)%Creset [%C(yellow)%an%Creset] %s%C(yellow)%d%Creset' --no-merges -- 'libnm-core/nm-json.?' 'libnm-core/nm-jansson.?'
  ...

  $ git shortlog -s --no-merges -- 'libnm-core/nm-json.?' 'libnm-core/nm-jansson.?'
     1    Beniamino Galvani
     1    Lubomir Rintel
     8    Thomas Haller

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2019-11-06 17:30:25 +01:00
Beniamino Galvani
14992ab9cd acd: poll the acd fd after starting the announcements
In nm_acd_manager_announce_addresses() we should not only start the
probes but also add the acd file descriptor to the main loop.
Otherwise, a timer is armed to send the announcements but it never
fires and no announcements are sent.

Fixes: d9a4b59c18 ('acd: adapt NM code and build options')

https://bugzilla.redhat.com/show_bug.cgi?id=1767681
2019-11-06 16:37:59 +01:00
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