summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* nm-device: change route table sync mode behaviourac/routes_full_syncAntonio Cardace2020-07-081-21/+48
| | | | | | | | | | | NM will now sync all tables when a connection has specified at least 1 local route in 'ipv[4|6].routes' to correctly reconcile local routes when reapplying connections on a device. If the connection has no local routes only the main table will be taken into account preserving the previous NM's behaviour. https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* platform: do not prune kernel added routesAntonio Cardace2020-07-081-1/+10
| | | | | | | IPv6 routes having metric 0 and routes having rt_source == kernel are entirely managed by kernel, NM should not try to remove them. https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* core: add dependent multicast route configured by kernel for IPv6Antonio Cardace2020-07-081-0/+21
| | | | | | | | | | Pre-generate the device multicast route in the local table that are configured by kernel when an ipv6-address is assigned to an interface. This helps NM taking into account routes that are not to be deleted when a connection is reapplied on an interface. https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* platform: parse route type from netlink messagesAntonio Cardace2020-07-081-0/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* utils: add 'unspecified' to nm_utils_route_type2str()Antonio Cardace2020-07-081-0/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* platform: always display route type when calling nmp_object_to_string()Antonio Cardace2020-07-081-5/+5
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1821787
* ppp: fix taking control of link generated by kernelBeniamino Galvani2020-07-083-12/+47
| | | | | | | | | | | | | | | | | | | | | | | | NetworkManager can't control the name of the PPP interface name created by pppd; so it has to wait for the interface to appear and then rename it. This happens in nm_device_take_over_link() called by nm-device-ppp.c:ppp_ifindex_set() when pppd tells NM the ifindex of the interface that was created. However, sometimes the initial interface name is already correct, for example when the connection.interface-name is ppp0 and this is the first PPP interface created. When this happens, nm_device_update_from_platform_link() is called on the NMDevicePPP and it sets the device ifindex. Later, when pppd notifies NM, nm_device_take_over_link() fails because the ifindex is already set: nm_device_take_over_link: assertion 'priv->ifindex <= 0' failed Make nm_device_take_over_link() more robust to cope with this situation. https://bugzilla.redhat.com/show_bug.cgi?id=1849386
* libnm-core: add test for mirred tc filterbg/tc-port-mirroring-rh1436535Beniamino Galvani2020-07-081-2/+49
|
* libnm-core: pass variant-attribute-spec for tc actionsBeniamino Galvani2020-07-081-2/+12
|
* libnm-core: don't print value for no-value attributesBeniamino Galvani2020-07-081-4/+6
|
* libnm-core: pass variant-attribute-spec to format functionBeniamino Galvani2020-07-084-11/+31
| | | | | | | | | | | | | The output of nm_utils_format_variant_attributes() must be accepted by nm_utils_parse_variant_attributes(), producing the initial attributes. The latter has a special handling of some attributes, depending on the input NMVariantAttributeSpec list. For example, if the NMVariantAttributeSpec is a boolean with the 'no_value' flag, the parser doesn't look for a value. Pass the NMVariantAttributeSpec list to the format function so that it can behave in the same way as the parse one.
* platform: support creation of prio qdiscBeniamino Galvani2020-07-081-0/+4
| | | | | | Support the creation of parameterless 'prio' qdiscs. The kernel needs a TCA_OPTIONS attribute initialized with default values. We currently don't support modifying the qdisc parameters.
* ndisc/tests: relax assertion in "test-ndisc-fake.c"Thomas Haller2020-07-071-1/+1
| | | | | | Still assertion failures: ERROR:../src/ndisc/tests/test-ndisc-fake.c:375:test_preference_changed_cb: assertion failed (_a->timestamp >= _ts): (9 >= 10)
* shared: add nm_steal_pointer()/nm_clear_free() to "nm-std-aux.h"Thomas Haller2020-07-071-0/+18
| | | | | | | | | There is the team of nm_auto*, nm_clear_pointer() and nm_steal_pointer(). These goes nicely together so that an autovariable owns a resource, to free it (clear) and to transfer ownership (steal). We have these also in glib, but we certainly also need it if we don't have glib because that very much goes together with nm_auto*. Add it.
* shared: move NM_AUTO_DEFINE_FCN*(), nm_auto_free and nm_clear_pointer() to ↵Thomas Haller2020-07-072-71/+76
| | | | "nm-std-aux.h"
* shared: drop definitions for bool/true/false from "nm-macros-internal.h"Thomas Haller2020-07-071-45/+0
| | | | | | | Previously, we did not have a hard dependency on C99. Nowadays, we actually build against C11, so we have <stdbool.h>. These definitions are no longer necessary nor do we care about building against plain C89.
* shared: include <stdbool.h> in "nm-std-aux.h" and fix glib-ismThomas Haller2020-07-071-5/+6
| | | | | | | For a long time already we build with gnu11/C11. We thus rely on having <stdbool.h> around, which is C99. Use it. Also fix "nm-std-aux.h" to not use TRUE/FALSE glib defines.
* shared: make NM_BOOLEAN_EXPR() macro composable and use it for _G_BOOLEAN_EXPR()Thomas Haller2020-07-072-26/+20
| | | | | | | | We redefine _G_BOOLEAN_EXPR(), so let it use NM_BOOLEAN_EXPR(). Also, we use G_LIKELY() (and thus NM_BOOLEAN_EXPR()) inside nm_assert(), and we use nm_assert() in some macros. To be able to nest nm_assert() calls, we need to create unique variable names for NM_BOOLEAN_EXPR().
* shared: move various basic helpers from "nm-macros-internal.h" to "nm-std-aux.h"Thomas Haller2020-07-072-244/+247
| | | | | These are generally useful and independent of glib. Move them to nm-std-aux, which has no glib dependency.
* core: fix treating route metric zero of IPv6 routes specialThomas Haller2020-07-079-64/+66
| | | | | | | | | | | | | | | | | Userspace cannot add IPv6 routes with metric 0. Trying to do that, will be coerced by kernel to route metric 1024. For IPv4 this is different, and metric zero is commonly allowed. However, kernel itself can add IPv6 routes with metric zero: # ip -6 route show table local local fe80::2029:c7ff:fec9:698a dev v proto kernel metric 0 pref medium That means, we must not treat route metric zero special for most cases. Only, when we want to add routes (based on user configuration), we must coerce a route metric of zero to 1024. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/563
* po: update Ukrainian (uk) translationYuri Chornoivan2020-07-071-768/+982
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/566
* docs: fix pre-generated documentation "clients/common/settings-docs.h.in"Thomas Haller2020-07-071-1/+1
| | | | Fixes: 4e33f8cd89fa ('all: fix minor typos')
* all: fix minor typosYuri Chornoivan2020-07-07106-182/+182
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/565
* nettools: reimport nettools' n-dhcp4Thomas Haller2020-07-072-12/+4
|\ | | | | | | git subtree pull --prefix shared/n-dhcp4/ git@github.com:nettools/n-dhcp4.git master --squash
| * Squashed 'shared/n-dhcp4/' changes from 6876b73ec113..5aeb53d149b4Thomas Haller2020-07-072-12/+4
| | | | | | | | | | | | | | 5aeb53d149b4 client: use jrand48 instead of mrand48_r git-subtree-dir: shared/n-dhcp4 git-subtree-split: 5aeb53d149b4a6108cae49c73c2308a7c5d52175
* | shared: add NM_N_ELEMENTS() macroThomas Haller2020-07-061-0/+2
| |
* | shared: move NM_SET_OUT() to "nm-std-aux.h"Thomas Haller2020-07-062-14/+16
| |
* | shared: move nm_utils_get_next_realloc_size() to nm-std-auxThomas Haller2020-07-064-95/+100
| |
* | shared: add "nm-std-aux/nm-std-utils.[hc]"Thomas Haller2020-07-065-7/+24
| | | | | | | | | | General purpose utilities for nm-std-aux. Contrary to "nm-std-aux.h", this is not header only.
* | shared: add min/max macros to "nm-std-aux.h"Thomas Haller2020-07-062-62/+65
| |
* | shared: add macros for declaration attribute to "nm-std-aux.h"Thomas Haller2020-07-062-47/+46
| |
* | shared: add nm_assert() to "nm-std-aux.h"Thomas Haller2020-07-062-25/+65
| | | | | | | | | | | | Having assertion macros that are disabled by default, is not only useful for our glib code, but should also be available for nm-std-aux. Move the macros.
* | shared: add "nm-std-aux/nm-std-aux.h" headerThomas Haller2020-07-063-0/+8
| | | | | | | | | | "nm-std-aux" is an utility library that has no glib depdencency. That is the difference to "nm-glib-aux".
* | ovs: merge branch 'bg/ovs-mac-pt2'Beniamino Galvani2020-07-063-48/+105
|\ \ | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1852106 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/557
| * | device: don't reset the MAC without ifindexBeniamino Galvani2020-07-061-11/+13
| | | | | | | | | | | | | | | | | | nm_device_cleanup() can be called when the device no longer has an ifindex. In such case, don't try to reset the MAC address as that would lead to an assertion failure.
| * | ovs: also set cloned MAC address via netlinkBeniamino Galvani2020-07-061-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already set the MAC of OVS interfaces in the ovsdb. Unfortunately, vswitchd doesn't create the interface with the given MAC from the beginning, but first creates it with a random MAC and then changes it. This causes a race condition: as soon as NM sees the new link, it starts IP configuration on it and (possibly later) vswitchd will change the MAC. To avoid this, also set the desired MAC via netlink before starting IP configuration. https://bugzilla.redhat.com/show_bug.cgi?id=1852106 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/483
| * | ovs: set MAC address on the bridge for local interfacesBeniamino Galvani2020-07-061-37/+77
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user creates a ovs-interface with the same name of the parent ovs-bridge, openvswitch considers the interface as the "local interface" [1] and assigns the MAC address of the bridge to the interface [2]. This is confusing for users, as the cloned MAC property is ignored in some cases, depending on the ovs-interface name. Instead, detect when the interface is local and set the MAC from the ovs-interface connection in the bridge table. [1] https://github.com/openvswitch/ovs/blob/v2.13.0/vswitchd/vswitch.xml#L2546 [2] https://github.com/openvswitch/ovs/blob/v2.13.0/vswitchd/bridge.c#L4744
* | initrd: merge branch 'bg/initrd-bootif'Beniamino Galvani2020-07-033-15/+58
|\ \ | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1853277 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/562
| * | initrd: write the hostname to stdout with --stdoutBeniamino Galvani2020-07-031-13/+18
| | | | | | | | | | | | | | | | | | | | | Don't try to open /run/NetworkManager/initrd when called with --stdout, but instead write the hostname to the standard output. Fixes: ff70adf873ef ('initrd: save hostname to a file in /run')
| * | initrd: fix generating default BOOTIF= connectionBeniamino Galvani2020-07-032-2/+40
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug when parsing a BOOTIF= without any existing connection. The generated connection doesn't have wired setting and later we try to access it: # nm-initrd-generator --stdout -- BOOTIF=01-50-50-00-9f-21-21 (nm-initrd-generator:1546): libnm-CRITICAL **: ((libnm-core/nm-setting-wired.c:205)): assertion '<dropped>' failed (nm-initrd-generator:1546): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed Fix this. https://bugzilla.redhat.com/show_bug.cgi?id=1853277 Fixes: 25a2b6e14ff5 ('initrd: rework command line parsing')
* | initrd: fix generation of MTU and cloned-mac-address for mastersbg/initrd-bond-cloned-macBeniamino Galvani2020-07-032-17/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting a MTU or a cloned MAC for bonds/bridges/teams fails with: # nm-initrd-generator -- bond=bond0:eno1,eno2:mode=802.3ad ip=192.168.1.5::192.168.1.254:255.255.255.0:MyServer:bond0:none::01:02:03:04:05:06 bootdev=bond0 nameserver=192.168.1.1 <warn> cmdline-reader: 'bond' does not support setting cloned-mac-address Fix this. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/460
* | ndisc/tests: fix assertion in "test-ndisc-fake.c"Thomas Haller2020-07-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First I wanted to fix test:ERROR:../src/ndisc/tests/test-ndisc-fake.c:373:test_preference_changed_cb: assertion failed (_a->timestamp == (data->timestamp1 + 3)): (9 == 10) but that leads to a different failure: test:ERROR:../src/ndisc/tests/test-ndisc-fake.c:375:test_preference_changed_cb: assertion failed (_a->lifetime == (9)): (10 == 9) Instead, the start and end times must match exact (in their duration), we only allow them to be shifted by up to one second. Fixes: 8209095ee1c4 ('ndisc/tests: relax the assertion in "test-ndisc-fake.c"')
* | cloud-setup: fix invalid assertion in nm_http_client_get_finish()Thomas Haller2020-07-031-1/+1
| | | | | | | | Fixes: 53bdd81800fa ('cloud-setup: ensure that nm_http_client_get_finish() always returns success or error')
* | cli: suppress "(unknown)" output in terse mode for device properties HWADDR ↵Thomas Haller2020-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and DRIVER $ nmcli -f GENERAL.HWADDR device show ovsport0 GENERAL.HWADDR: (unknown) but: $ nmcli -f GENERAL.HWADDR --terse device show ovsport0 GENERAL.HWADDR: This is an API change of nmcli.
* | cli: add nmc_meta_generic_get_str_i18n_null() helperThomas Haller2020-07-031-0/+18
| |
* | all: fix typo in man pagesSayed Shah2020-07-0358-109/+109
| | | | | | | | | | | | | | | | There should be a comma after 'Otherwise' and 'Currently'. https://bugzilla.redhat.com/show_bug.cgi?id=1852452 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/560
* | cloud-setup: merge branch 'th/cloud-setup-various'Thomas Haller2020-07-037-162/+286
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/553
| * | cloud-setup: don't check redundant error results from ↵Thomas Haller2020-07-032-41/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | nm_http_client_poll_get_finish() nm_http_client_poll_get_finish() can only either succeed (returning TRUE and setting no GError), or failing (returning FALSE and setting GError). Checking for both is redundant and unnecessary.
| * | cloud-setup: ensure that nm_http_client_get_finish() always returns success ↵Thomas Haller2020-07-031-4/+11
| | | | | | | | | | | | or error
| * | cloud-setup: always report success or an GError from ↵Thomas Haller2020-07-032-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_http_client_poll_get_finish()/nmcs_utils_poll_finish() Since commit 3bd30f6064c3 ('nmcs: add error message when a HTTP request times out'), the case where polling returns %FALSE without an error is no longer possible. This is preferable, because it follows a consistent API where a function clearly fails or succeeds. So, checking for the error code and the returned boolean is redundant and unnecessary.