Commit graph

26657 commits

Author SHA1 Message Date
Antonio Cardace
5cca669ff3
core: add 'dhcp-vendor-class-identifier' validation function
So that it can be reused.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-01 09:34:29 +02:00
Yuri Chornoivan
f15c7bbe8d
po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/615
2020-08-31 13:38:07 +02:00
Thomas Haller
6b63b68a41
contrib: accept missing .sig file for older releases in "release.sh"
On older branches, the build script does not create a GPG signature of
the release tarball. Let the release script be graceful against that.
2020-08-31 13:20:24 +02:00
Beniamino Galvani
e404585e60 device: fix autoactivating virtual devices after a failure
When a virtual device fails, its state goes to FAIL and then
DISCONNECTED. In DISCONNECTED we call schedule_activate_check() to
schedule an auto-activation if needed. We also schudule the deletion
of the link through delete_on_deactivate_check_and_schedule(). The
auto-activation attempt fails because the link deletion unmanages the
device; as a result, the device doesn't try to auto-activate again.

To fix this:

 - don't allow the device to auto-activate if the device deletion is
   pending;

 - check again if the device can be auto-activated after its deletion.

https://bugzilla.redhat.com/show_bug.cgi?id=1818697
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/613
2020-08-31 11:41:23 +02:00
Thomas Haller
a75dfc73e2
dhcp: workaround "maybe-uninitialized" in dhcp_event_cb()
With LTO we get a compiler warning:

    src/dhcp/nm-dhcp-systemd.c: In function dhcp_event_cb:
    src/dhcp/nm-dhcp-systemd.c:554: error: lease may be used uninitialized in this function [-Werror=maybe-uninitialized]
      554 |   r = sd_dhcp_lease_get_server_identifier (lease, &addr);
          |
    src/dhcp/nm-dhcp-systemd.c:528: note: lease was declared here
      528 |  sd_dhcp_lease *lease;
          |

Fixes: 7f217d0345 ('core: honor the ipv4.dhcp-reject-servers property')
2020-08-28 14:28:56 +02:00
Thomas Haller
12e8557476
gitlab-ci: fix workarounds for Ubuntu 16.04 in tests
The detection for Ubuntu 16.04 was broken. By now /etc/os-release
contains

    VERSION="16.04.7 LTS (Xenial Xerus)"
2020-08-28 14:24:32 +02:00
Thomas Haller
918ebd600a
device: fix casting pointer to enum for sriov_reset_on_deactivate_cb()
Avoids a compiler warning:

    ../src/devices/nm-device.c:16079:26: error: cast to smaller integer type 'NMDeviceStateReason' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast]
            deactivate_ready (self, (NMDeviceStateReason) reason);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 121c58f0c4 ('core: set number of SR-IOV VFs asynchronously')
2020-08-28 12:39:56 +02:00
Thomas Haller
818d146d88
core/trivial: replace "XXX" markers with "TODO"
"XXX" is used for tagging parts of code that still need work before
merging a patch. If you want to highlight/mark a comment which is merged
use either "TODO" or "FIXME".

Of course, even "TODO" and "FIXME" should be avoided in favor of just
doing/fixing it. Such things tend to never be done/fixed.
2020-08-27 17:10:55 +02:00
Beniamino Galvani
bc4c81fb43 dhcp: merge branch 'bg/dhcp-reject-servers'
https://bugzilla.redhat.com/show_bug.cgi?id=1827410
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/581
2020-08-26 17:30:45 +02:00
Beniamino Galvani
b609088ae6 dhcp: nettools: change event handler signature 2020-08-26 17:28:45 +02:00
Beniamino Galvani
7f217d0345 core: honor the ipv4.dhcp-reject-servers property 2020-08-26 17:28:45 +02:00
Beniamino Galvani
757fa4711f all: add ipv4.dhcp-reject-servers property
Add a new dhcp-reject-servers property to the ipv4 setting, that
allows specifying a list of server-ids from which offers should be
rejected.
2020-08-26 17:28:45 +02:00
Beniamino Galvani
c25aed5051 n-dhcp4: add n_dhcp4_client_lease_get_server_identifier()
Add new API to query the server identifier of a lease.
2020-08-26 17:08:15 +02:00
Beniamino Galvani
ae7d1e2b7a libnm-core: use nm_strvarray_remove_first() 2020-08-26 17:08:13 +02:00
Beniamino Galvani
418d20acc9 shared: add nm_strvarray_remove_first()
Co-authored-by: Thomas Haller <thaller@redhat.com>
2020-08-26 17:08:00 +02:00
Antonio Cardace
dbab673f76
libnm: move nm_setting_ip4_config_get_dhcp_vendor_class_identifier() to "libnm_1_26_4"
nm_setting_ip4_config_get_dhcp_vendor_class_identifier() was
backported to nm-1-26 branch, and will be released as 1.26.4.
As such, on the stable branch the symbol will be placed in a
separate symbol version ("libnm_1_26_4").

To support the upgrade path from 1.26.4+ to 1.28+, we
want this symbol also present on master.

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 15:23:23 +02:00
Antonio Cardace
21e6ed2852
dhcp: merge branch 'ac/dhcp_vendor_class_opt'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/610
2020-08-26 09:45:24 +02:00
Antonio Cardace
5da0939a3f
dhcp: implement dhcp-vendor-class-identifier option for systemd's DHCP
client

https://bugzilla.redhat.com/show_bug.cgi?id=1871042
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 09:44:11 +02:00
Antonio Cardace
f8a7290153
dhcp: implement dhcp-vendor-class-identifier option for internal DHCP client
https://bugzilla.redhat.com/show_bug.cgi?id=1871042
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 09:44:10 +02:00
Antonio Cardace
f71f40bc20
core: add support for dhcpv4 vendor class identifier option
https://bugzilla.redhat.com/show_bug.cgi?id=1871042
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 09:44:09 +02:00
Antonio Cardace
e9ed5f02ba
ifcfg-rh: add support for the DHCP_VENDOR_CLASS_IDENTIFIER option
https://bugzilla.redhat.com/show_bug.cgi?id=1871042
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 09:44:09 +02:00
Antonio Cardace
d7235394b2
libnm-core,clients: add support for ipv4.dhcp-vendor-class-identifier option
https://bugzilla.redhat.com/show_bug.cgi?id=1871042
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-08-26 09:44:05 +02:00
Thomas Haller
9b54d175bf
shared: avoid multiple strlen() calls in _nm_utils_strv_dup_packed()
Instead of calling strlen() for all strings twice, remember the length
in a temporary buffer.

Yes, this is measurably faster.
2020-08-25 12:45:26 +02:00
Thomas Haller
2e0cd52474
shared: add nm_utils_strv_dup_packed() util 2020-08-25 09:54:11 +02:00
Thomas Haller
c25f4d947a
shared: enforce compatible C-type argument for nm_utils_strv_dup()
Use a macro that uses NM_CAST_STRV_CC() to cast the strv argument. Note that
NM_CAST_STRV_CC() uses C11's _Generic() to check whether the argument is
of a valid type.
2020-08-25 08:54:36 +02:00
Thomas Haller
94b4276058
dns: merge branch 'th/dns-rc-manager-auto'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/602
2020-08-24 21:18:06 +02:00
Thomas Haller
c1f9a0fff1
dns: add new "rc-manager=auto" mode
Add a new `main.rc-manager=auto` setting, that favours to use
systemd-resolved (and not touch "/etc/resolv.conf" but configure
it via D-Bus), or falls back to `resolvconf`/`netconfig` binaries
if they are installed and enabled at compile time.
As final fallback use "symlink", like before.

Note that on Fedora there is no "openresolv" package ([1]). Instead, "systemd"
package provides "/usr/sbin/resolvconf" as a wrapper for systemd-resolved's
"resolvectl". On such a system the fallback to resolvconf is always
wrong, because NetworkManager should either talk to systemd-resolved
directly or not but never call "/usr/sbin/resolvconf". So, the special handling
for resolvconf and netconfig is only done if NetworkManager was build with these
applications explicitly enabled.

Note that SUSE builds NetworkManager with

    --with-netconfig=yes
    --with-config-dns-rc-manager-default=netconfig

and the new option won't be used there either. But of course, netconfig
already does all the right things on SUSE.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=668153

Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-08-24 21:13:21 +02:00
Thomas Haller
c752c52b76
dns: add fixme comment to not block while writing to resolvconf/netconfig
Arguably, a fixme comment isn't useful. It would be better to fix it.
On the other hand, nowadays these modes are not very popular and usually
not used. If somebody cares, please provide a patch.
2020-08-24 21:10:29 +02:00
Beniamino Galvani
935e9a4f92 dhcp: merge branch 'bg/nettools-options'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/592
2020-08-24 16:53:53 +02:00
Beniamino Galvani
01a1eaf02f dhcp: nettools: parse some missing option
Add support for the following options to the nettool client:

- Network Information Service Domain (40)
- Network Information Servers (41)
- NetBIOS over TCP/IP Name Server (44)

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/592
2020-08-24 16:51:53 +02:00
Beniamino Galvani
5fbc967fb8 dhcp: nettools: use generic function to parse address lists 2020-08-24 16:51:53 +02:00
Beniamino Galvani
8113069062 shared: add nm_is_ascii()
glib's is{alnum,alpha,ascii,...}() functions perform the check based
on the current locale. Probably using isascii() would be fine anyway,
but add a NM version that just checks that the upper bit is zero.
2020-08-24 16:51:53 +02:00
Changwoo Ryu
94ded0c5b2
po: Update Korean translation
Signed-off-by: Changwoo Ryu <cwryu@debian.org>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/611
2020-08-24 16:21:58 +02:00
Thomas Haller
7fbfe4381e
shared/trivial: add gtk-doc for nm_utils_buf_utf8safe_unescape() 2020-08-24 15:19:12 +02:00
Thomas Haller
72d8b15993
platform: merge branch 'ss/NMPObject1'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/607
2020-08-21 15:30:14 +02:00
Thomas Haller
80c0de7217
platform: workaround for old kernels that don't support IFLA_BR_VLAN_STATS_ENABLED
The kernel of Ubuntu 16.04 doesn't support IFLA_BR_VLAN_STATS_ENABLED.
If we want to run on such old kernels (which we probably do), we need to
detect that, and act accordingly.
2020-08-21 13:59:50 +02:00
Thomas Haller
1407d29b5e
platform/tests: add nmtstp_kernel_support_get() 2020-08-21 13:59:49 +02:00
Thomas Haller
195b406ac0
platform: extend nm_platform_kernel_support_get() and use atomic operations to access result
Add nm_platform_kernel_support_get_full() to allow fetching the support
state without setting it to the compile time default.

Also, use g_atomic_int_get() to access _nm_platform_kernel_support_state
values. We should not access static variables without synchronization.
Better get it correct in any case than fast.
2020-08-21 13:59:48 +02:00
Thomas Haller
e59259b3d5
platform/tests: remove unused argument "out_not_supported" from nmtstp_link_bridge_add() 2020-08-21 13:59:48 +02:00
Thomas Haller
9a5e8f1ea6
platform: use defines from libnm-core for setting defaults values for nm_platform_lnk_bridge_default 2020-08-21 13:59:47 +02:00
Thomas Haller
fdef0e8c62
platform: fix default for bridge setting "mcast_snooping"
The value defaults to TRUE. Also, use the #define for it.

Fixes: 58847f85a4 ('platform: use netlink for configuring bridge settings'):
2020-08-21 13:59:40 +02:00
Thomas Haller
a3d57721e6
core: use defines for sysfs values of bridge attributes (group-address and vlan-protocol) 2020-08-21 13:50:33 +02:00
Sayed Shah
58847f85a4 platform: use netlink for configuring bridge settings
NMDeviceBridge is currently using sysfs. The plan is to use netlink in
in the future
2020-08-20 14:03:10 -04:00
Sayed Shah
f5db085cd3 shared: add a struct and definition for MAC address
This is a shared util which adds an array of 6 bytes and also add define statements
for how to format the MAC address
2020-08-20 13:27:32 -04:00
Thomas Haller
e1e1241aae
gitlab-ci: enable fedora:33 build and generate pages on F32 2020-08-18 23:31:50 +02:00
Thomas Haller
2c12786e3d
contrib/rpm: enable LTO by default on RHEL-9 and newer 2020-08-18 23:00:20 +02:00
Thomas Haller
44f4a458c2
nettools: reimport nettools' n-dhcp4
git subtree pull --prefix shared/n-dhcp4/ git@github.com:nettools/n-dhcp4.git master --squash
2020-08-17 15:38:35 +02:00
Thomas Haller
2372b562f9 Squashed 'shared/n-dhcp4/' changes from 03d38e83e558..8c91e9ae8999
8c91e9ae8999 trivial: fix spelling in code comment
433998d2be78 merge branch 'th/fix-lto-compiler-warnings'
6c6e9368989e connection: avoid compiler warning in n_dhcp4_c_connection_connect() about fd_udp uninitialized
142eedcfc332 packet: avoid compiler warning in n_dhcp4_c_socket_packet_recv()

git-subtree-dir: shared/n-dhcp4
git-subtree-split: 8c91e9ae8999e69edde642e8e9cac206a54e2c0d
2020-08-17 15:36:30 +02:00
Thomas Haller
b8ac53905d
build: merge branch 'th/fix-lto'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/605
2020-08-17 15:20:59 +02:00
Thomas Haller
839ba57c7f
contrib/rpm: enable LTO by default on Fedora 33
With Fedora 33, LTO will be enabled by default via CFLAGS in
redhat-rpm-config ([1]).

That basically sets "CFLAGS=-flto -ffat-lto-objects".

Note that we have our own configure/meson option to enable LTO.
With "--with-lto" we set CFLAGS="-flto -flto-partition=none". This
is necessary due ([2], [3]).

So, disable Fedora's automatism, but turn on the suitable configure
option to get working LTO.

[1] 5baaf4a99c
[2] e6cf4213a7 ('build: fix building with LTO')
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28
2020-08-17 15:20:08 +02:00