Commit graph

26695 commits

Author SHA1 Message Date
Thomas Haller
bd054bf6fd
l3cfg: remove changed flag from nm_l3cfg_add_config()/nm_l3cfg_remove_config() 2020-09-07 16:11:50 +02:00
Thomas Haller
41b9d44f9b
l3cfg: drop unused NM_L3_CONFIG_MERGE_FLAGS_EXTERNAL
The current approach also tracks external configuration in an NMIP[46]Config, and
we need to special handle those. In the future, we only want to track what we actually
want to configure. So this flag won't be used with NML3Cfg/NML3ConfigData.
2020-09-07 16:11:50 +02:00
Thomas Haller
38b2239146
l3cfg: add more l3cfg API that will be used next 2020-09-07 16:11:50 +02:00
Thomas Haller
e89a095673
l3cfg: add nm_l3_config_data_get_blacklisted_ip4_routes() util
We will need to prune routes that kernel adds (and we don't want).
2020-09-07 16:11:49 +02:00
Thomas Haller
0ab341b9e6
l3cfg: add nm_l3_config_data_get_domains() accessor 2020-09-07 16:11:49 +02:00
Thomas Haller
137d02a7e6
platform: add nm_platform_ip_address_get_peer_address() helper 2020-09-07 16:11:49 +02:00
Thomas Haller
97c1bed37e
build: add test for valid po files (msgfmt -vc) 2020-09-07 14:56:50 +02:00
Thomas Haller
a39e1ab16e
po: merge branch 'th/po-fix-fr-ja-zh_CN'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/526

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/619
2020-09-07 13:53:57 +02:00
Thomas Haller
a4f99bab1d
gitlab-ci: add test for checking po files 2020-09-04 10:11:41 +02:00
Thomas Haller
60b2e7452f
po: remove invalid translations from po/{fr,ja,zh_CN}.po
And `make -C po update-po` to regenerate the default.
2020-09-04 10:01:28 +02:00
Thomas Haller
9ee13a5656
po: make update-po 2020-09-04 10:01:20 +02:00
Thomas Haller
8495e8fcb3
l3cfg: merge branch 'th/l3cfg-6-acd'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/612
2020-09-03 17:50:48 +02:00
Thomas Haller
e4f04267bb
l3cfg: implement IPv4 DAD/ACD (address collision detection) in NML3Cfg
Currently, NMDevice does ACD. It intercepts certain NMIP4Config
instances, and tries to perform ACD on the addresses. I think this
functionality should be handled by NML3Cfg instead.

For one, NML3Cfg sees all configurations, and can perform ACD for all
(relevant) addresses. Also, it moves logic away from NMDevice and makes
the functionality available without an NMDevice. As such, it also will
allow that independent "controllers" contribute NML3ConfigData instances
and ACD will performed for all of them (as requested).

This will be our implementation for IPv4 ACD (https://tools.ietf.org/html/rfc5227)
based on nettools' n-acd library.

The code is not actually tested yes, because NMDevice did not yet switch
over to use NML3Cfg. Once that happens, surely issues with this patch
will be found that will need fixing.
2020-09-03 11:52:39 +02:00
Thomas Haller
f81360bbbf
platform: add nm_platform_ip4_address_addr_to_hash() helper
This will only have one particular use, from NNL3Cfg. However, it seems
general enough to place it in "nm-platform.h".
2020-09-03 11:39:39 +02:00
Thomas Haller
aed61588fd
shared: add nm_utils_bin2hexstr_a() macro 2020-09-03 11:39:39 +02:00
Thomas Haller
265a5879ae
shared: add nm_g_timeout_source_new_seconds() 2020-09-03 11:39:39 +02:00
Thomas Haller
fc66ad70d5
shared: add nm_g_hash_table_contains() helper 2020-09-03 11:39:39 +02:00
Thomas Haller
bff23d15d4
initrd/tests: fix memleak in test_dhcp_vendor_class_id()
Having leaks in the tests, breaks running the test under valgrind. There
must be no leaks.

Fixes: c056cb9306 ('initrd: parse 'rd.net.dhcp.vendor-class' kernel cmdline arg')
2020-09-03 11:36:39 +02:00
Thomas Haller
07955c020f
release: bump version to 1.27.2 (development) 2020-09-02 20:03:10 +02:00
Antonio Cardace
eebed47257
contrib: add git-hook to verify code-style
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-02 19:20:40 +02:00
Antonio Cardace
5119d00374
scripts: better error message for nm-code-format.sh
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-02 19:20:36 +02:00
Thomas Haller
eda1ef4242
all: merge branch 'th/unify-nm-auto-macros' 2020-09-02 17:46:45 +02:00
Thomas Haller
15be2bb3fd
shared: redefine "gs_*" cleanup macros to their "nm_auto*" counterparts 2020-09-02 17:46:44 +02:00
Thomas Haller
c7a724fd53
all: replace cleanup macro "gs_free_slist" by "nm_auto_free_slist" 2020-09-02 17:46:43 +02:00
Thomas Haller
426a4c9d50
all: replace cleanup macro "gs_unref_keyfile" by "nm_auto_unref_keyfile" 2020-09-02 17:46:43 +02:00
Thomas Haller
63f304ad58
shared: add "nm_auto*" macros as future replacements for "gs_*" cleanup macros
We still use the "gs_*" macros that we originally got from libgsystem.
libgsystem no longer exists, we only still use the names of these
macros.

Our own cleanup macros all follow the "nm_auto*" naming pattern.
Eventually, we want to replace all uses of "gs_*" with cleanup macros
that follow our naming scheme.

Add the macros that will be used to replace the "gs_*" macros.
2020-09-02 17:46:43 +02:00
Antonio Cardace
715392a45e
scripts: add script to format codebase using clang-format
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-02 17:31:42 +02:00
Thomas Haller
9c732c12bd
man: expand DEBUGGING section in man NetworkManager 2020-09-02 16:45:14 +02:00
Thomas Haller
ab8b148d41
man: update bug tracker in man NetworkManager 2020-09-02 15:56:10 +02:00
Thomas Haller
b1e7fb9757
core: log message about secret-key version and filename 2020-09-02 15:12:53 +02:00
Thomas Haller
4018504247
man: fix description of v2 secret key in man NetworkManager
Fixes: 0aa09da5f4 ('man: explain "/var/lib/NetworkManager/secret-key" in `man NetworkManager`')
2020-09-02 14:52:46 +02:00
Thomas Haller
0aa09da5f4
man: explain "/var/lib/NetworkManager/secret-key" in man NetworkManager 2020-09-02 12:10:04 +02:00
Thomas Haller
4a084a2bcb
shared: rename "gs_local_option_context" to "nm_auto_free_option_context"
The "gs_*" macros originate from the (no longer existing) libgsystem library.
We still have them, because so far we didn't go through the effort of
renaming the API.

Aside that oddity, our cleanup API is called "nm_auto*". There is no need
to add new API with the old name.
2020-09-02 10:36:58 +02:00
Antonio Cardace
d5c05d07c7
initrd: fix memory leak
Signed-off-by: Antonio Cardace <acardace@redhat.com>
Fixes: 9f9609555d ('initrd: add configuration generator')
2020-09-01 19:05:10 +02:00
Thomas Haller
d619de7727
shared/trivial: add code comment about the purpose of "nm-default.h" header 2020-09-01 17:27:17 +02:00
Thomas Haller
cc763243e0
libnm: fix order of includes in "libnm-core/nm-libnm-core-intern/nm-libnm-core-utils.c" 2020-09-01 17:21:31 +02:00
Antonio Cardace
5748e986aa
initrd: merge branch 'ac/dhcpclass-initrd'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/614

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-01 16:59:19 +02:00
Antonio Cardace
c056cb9306
initrd: parse 'rd.net.dhcp.vendor-class' kernel cmdline arg
This arguments makes NM set the ipv4.dhcp-vendor-class-identifier
property for all connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1872299

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-09-01 11:14:46 +02:00
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