summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bridge: assume wired settings are therelr/bridge-wiredLubomir Rintel2022-05-101-4/+5
| | | | | | | | | We can now assert instead of checking. Also, let's move the whole get-the-mtu part down closer to where it is actually used. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1208
* core/connection: ensure wired settings are around for bridgesLubomir Rintel2022-05-103-1/+16
| | | | | | | | | | | | | | Bridges are wired ethernet bridges, it makes sense for them to have wired ethernet settings. Ensuring they always exist makes reapplying the MTU changes more convenient. The MTU for bridges is taken from wired settings, making it impossible to change and reapply it for connections that lack them (as reapply doesn't really cope well with addition and removal of settings). https://bugzilla.redhat.com/show_bug.cgi?id=2076131 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1208
* bond: drop _get_option_or_default() and use _get_option_normalized()Fernando Fernandez Mancera2022-05-103-15/+4
| | | | | | | Currently nm_setting_bond_get_option_normalized() and nm_setting_bond_get_option_or_default() are identical functions. As the first one is exposed as public API and has a better name, let's drop the second one.
* nmtui: merge branch 'gfm:nmtui-tun-tap'Thomas Haller2022-05-092-7/+10
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1214
| * nmtui: add support for activating tun/tap connectionsOlivier Gayot2022-05-092-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tun/tap connections can be created using a command such as: $ nmcli connection add type tun ifname tun0 mode tap owner 1000 They appear in nmcli connection as TYPE "tun". This patch adds the ability to activate and deactivate this type of connection using nmtui. Each connection of TYPE "tun" appears as: TUN/TAP (<ifname>) * <connection-name> Example: TUN/TAP (tap0) * bridge-slave-tap0 TUN/TAP (tap1) bridge-slave-tap1
| * nm-connection.c: replace !strcmp() expressions by nm_streq()Olivier Gayot2022-05-091-7/+7
|/
* core: merge branch 'th/fix-clear-ip6-temp-addrs'Thomas Haller2022-05-094-59/+115
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1209
| * l3cfg: refresh platform cache before creating prune list during L3Cfg commitThomas Haller2022-05-091-0/+2
| | | | | | | | | | It seems, we should make decisions based on the latest state. Make sure to process all pending netlink events.
| * l3cfg: fix clearing IPv6 temporary addresses to avoid stale addressesThomas Haller2022-05-093-59/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPv6 temporary addresses are configured by kernel, with the "ipv6.ip6-privacy" setting ("use_tempaddr" sysctl) and the IFA_F_MANAGETEMPADDR flag. As such, the idea was that during reapply we would not remove them. However, that is wrong. The only case when we want to keep those addresses, is if during reapply we are going to configure the same primary address (with mngtmpaddr flag) again. Otherwise, theses addresses must always go away. This is quite serious. This not only affects Reapply. Also during disconnect we clear IP configuration via l3cfg. Have an ethernet profile active with "ipv6.ip6-privacy". Unplug the cable, the device disconnects but the temporary IPv6 address is not cleared. As such, nm_device_generate_connection() will now generate an external profile (with "ipv6.method=disabled" and no manual IP addresses). The result is, that the device cannot properly autoconnect again, once you replug the cable. This is serious for disconnect. But I could not actually reproduce the problem using reapply. That is, because during reapply we usually toggle ipv6_disable sysctl, which drops all IPv6 addresses. I still went through the effort of trying to preserve addresses that we still want to have, because I am not sure whether there are cases where we don't toggle ipv6_disable. Also, doing ipv6_disable during reapply is bad anyway, and we might want to avoid that in the future. Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
| * glib-aux: add nm_g_array_data() helperThomas Haller2022-05-091-0/+6
|/ | | | | | | | | It's annoying to do (arr ? arr->data : NULL) Especially, because usually you'd need to cast the above (which would have type (char *)).
* all: merge branch 'th/clean-includes'Thomas Haller2022-05-095-76/+74
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1205
| * daemon-helper: include "libnm-std-aux/nm-default-std.h" as first in ↵Thomas Haller2022-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | "nm-daemon-helper.c" All our sources should include one of the "nm-default*.h" headers first. That one drags in <config.h>, which must be included first and a few other basics. Which is the right "nm-default*.h" header depends on the component. In case of "nm-daemon-helper.c", it's "libnm-std-aux/nm-default-std.h".
| * std-aux: include default std-aux headers by "nm-default-std.h"Thomas Haller2022-05-092-2/+5
| |
| * all: drop redundant includesThomas Haller2022-05-092-5/+0
| |
| * code-style: fix wrong indentation for code commentsThomas Haller2022-05-092-67/+67
|/
* glib-aux: merge branch 'th/str-buf-stack-allocated'Thomas Haller2022-05-0913-53/+136
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1203
| * glib-aux: avoid #if in "nm-str-buf.h"Thomas Haller2022-05-091-4/+4
| | | | | | | | | | NM_MORE_ASSERT is a compile time constant. The compiler can optimize it away just fine.
| * glib-aux: drop nm_str_buf_init() for NM_STR_BUF_INIT()Thomas Haller2022-05-0913-30/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | NM_STR_BUF_INIT() and nm_str_buf_init() were pretty much redundant. Drop one of them. Usually our pattern is that we don't have functions that return structs. But NM_STR_BUF_INIT() returns a struct, because it's convenient to use with nm_auto_str_buf NMStrBuf strbuf = NM_STR_BUF_INIT(...); So use that variant instead.
| * glib-aux: add support for starting with stack-allocated buffer in NMStrBufThomas Haller2022-05-093-23/+115
|/ | | | | | | | | | | | | | | | | | | Allow to initialize NMStrBuf with an externally allocated array. Usually a stack buffer. If the NMStrBuf grows beyond the size of that initial buffer, then it would switch using malloc. The idea is to support the common case where the result is small enough to fit on the stack. I always wanted to do such optimization because the main purpose of NMStrBuf is to put it on the stack and ad-hoc construct a string. I just figured, it would complicate the implementation and add a runtime overhead. But turns out, it doesn't really. The biggest question is how NMStrBuf should behave with a pre-allocated buffer? Turns out, most choices can be made in a rather obvious way. The only non-obvious thing is that nm_str_buf_finalize() would malloc() a buffer, but that too seems consistent and what a user would probably expect. As such, this doesn't seem to add unexpected semantics to the API.
* device: commit l3cfg on link change only when the device is activatingBeniamino Galvani2022-05-091-1/+2
| | | | | | | | | | On link change, the configuration should be reapplied only when the device is activating. Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') https://bugzilla.redhat.com/show_bug.cgi?id=2079054 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1216
* merge: branch 'lr/gtkdoc'Lubomir Rintel2022-05-0659-142/+95
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1211
| * libnm-client: fix some commentslr/gtkdocLubomir Rintel2022-05-061-4/+4
| | | | | | | | | | Correct the mismatched arguments and descriptions, likely a copy & paste error.
| * libnm: fix placement of some "Since:" tagsLubomir Rintel2022-05-065-14/+14
| | | | | | | | | | | | | | | | | | | | libnm-client-impl/nm-client.c:8398: warning: multi-line since docs found libnm-client-impl/nm-device-macvlan.c:115: warning: multi-line since docs found libnm-client-impl/nm-device-vxlan.c:540: warning: multi-line since docs found libnm-client-impl/nm-device-vxlan.c:92: warning: multi-line since docs found libnm-core-impl/nm-setting-ethtool.c:41: warning: multi-line since docs found libnm-core-impl/nm-setting-ip-config.c:2475: warning: multi-line since docs found libnm-core-impl/nm-setting-ip-config.c:2504: warning: multi-line since docs found
| * libnm: replace nm-types.h by defining the types in respective headersLubomir Rintel2022-05-0655-124/+77
|/ | | | | | | | | | | | | | | | | | | | | | | The typedefs in nm-types.h confuse gtkdoc-scan. It generates a libnm-sections.txt file like this: <SECTION> <FILE>nm-types</FILE> <TITLE>NMDeviceOvs</TITLE> NMAccessPoint NMActiveConnection NMCheckpoint NMClient NMDevice ... Note the wrongly picked title and, more importantly, the object types in a bogus section. This in turn makes gtkdoc-mkdb fail to include the property and signal documentation in appropriate sections. Without nm-types.h, we need to mind the header dependencies. This means that we need to order the headers that define types before the ones that use them. Also, we need to break the depencency loops in few palces.
* n-dhcp4: re-import git-subtree for 'src/n-dhcp4'Thomas Haller2022-05-060-0/+0
|\ | | | | | | git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
| * Squashed 'src/n-dhcp4/' changes from 64513e31c01a..e4af93228e37Thomas Haller2022-05-063-2/+21
| | | | | | | | | | | | | | | | e4af93228e37 probe: forget lease after a NAK c39e1fe74463 connection: discard NAKs from other servers in SELECTING git-subtree-dir: src/n-dhcp4 git-subtree-split: e4af93228e3772bbb443ec1237252e6a2f3e3dd7
* | n-dhcp4/probe: forget lease after a NAKBeniamino Galvani2022-05-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a lease and we get a NAK renewing/rebinding it, the lease is lost. Without this, probe->current_lease remains set and after the next DISCOVER/OFFER round, any call to n_dhcp4_client_lease_select() will fail at: if (lease->probe->current_lease) return -ENOTRECOVERABLE; As in: [5325.1313] dhcp4 (veth0): send REQUEST of 172.25.1.200 to 255.255.255.255 [5325.1434] dhcp4 (veth0): received NACK from 172.25.1.1 [5325.1435] dhcp4 (veth0): client event 3 (RETRACTED) [5325.1436] dhcp4 (veth0): send DISCOVER to 255.255.255.255 [5325.1641] dhcp4 (veth0): received OFFER of 172.25.1.200 from 172.25.1.1 [5325.1641] dhcp4 (veth0): client event (OFFER) [5325.1641] dhcp4 (veth0): selecting lease failed: -131 (ENOTRECOVERABLE) Upstream: https://github.com/nettools/n-dhcp4/pull/33 Upstream: https://github.com/nettools/n-dhcp4/commit/e4af93228e3772bbb443ec1237252e6a2f3e3dd7 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/993 e43b1791a382 ('Merge commit 'e23b3c9c3ac86b065eef002fa5c4321cc4a87df2' as 'shared/n-dhcp4'')
* | c-list: re-import git-subtree for 'src/c-list'Thomas Haller2022-05-069-21/+184
|\ \ | | | | | | | | | git subtree pull --prefix src/c-list git@github.com:c-util/c-list.git main --squash
| * | Squashed 'src/c-list/' changes from a0970f12f1f4..b86ba656ac22Thomas Haller2022-05-069-21/+184
| | | | | | | | | | | | | | | | | | | | | | | | b86ba656ac22 c-list: add c_list_split() 76900e4e3625 build: align with new c-util style git-subtree-dir: src/c-list git-subtree-split: b86ba656ac22b00fe785b2f058123e807f97c109
* | | c-rbtree: re-import git-subtree for 'src/c-rbtree'Thomas Haller2022-05-0612-53/+59
|\ \ \ | | | | | | | | | | | | git subtree pull --prefix src/c-rbtree git@github.com:c-util/c-rbtree.git main --squash
| * | | Squashed 'src/c-rbtree/' changes from 8aa7bd1828ee..9b9713aeb9ecThomas Haller2022-05-0612-53/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9b9713aeb9ec build: update docs 7d38954dfd69 c-rbtree: document c_rbtree_entry() better 401241d4db02 build: always build test-parallel 337eb6c06d48 build: declare meson dependency 5741c13745cc ci: switch to new c-util CI workflow 39f870caf0aa build: drop redundant _GNU_SOURCE cd315e186cf0 build: define 'ptrace' option a1fb0a3296ae build: drop old submodules 739c1e982d74 build: re-order build definitions alphabetically e98d4ed5a863 build: rework dependency handling f9dd3852b8de build: use both_libraries() git-subtree-dir: src/c-rbtree git-subtree-split: 9b9713aeb9eca98566a85c8c90a02942ea430819
* | | | c-siphash: re-import git-subtree for 'src/c-siphash'Thomas Haller2022-05-068-39/+30
|\ \ \ \ | | | | | | | | | | | | | | | git subtree pull --prefix src/c-siphash git@github.com:c-util/c-siphash.git main --squash
| * | | | Squashed 'src/c-siphash/' changes from eb87a9c4a5b0..1da8a0d46bfdThomas Haller2022-05-068-39/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1da8a0d46bfd build: align with new c-util style git-subtree-dir: src/c-siphash git-subtree-split: 1da8a0d46bfdf07dc263a33ea9f22682db7dbea0
* | | | | c-stdaux: re-import git-subtree for 'src/c-stdaux'Thomas Haller2022-05-063-11/+8
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
| * | | | | Squashed 'src/c-stdaux/' changes from f20e1cf2dfb1..99fe83cd5698Thomas Haller2022-05-063-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 99fe83cd5698 build: update copyright 344b3ca8ce29 build: declare meson dependency 0e0982fd327e ci: use v1 of cabuild 9d2dafc4aaa4 ci: enable matrix-mode 822e358e60bb ci: switch to new C-Util CI 45b322aa6fb4 ci: try out new cabuild workflow git-subtree-dir: src/c-stdaux git-subtree-split: 99fe83cd5698b406f1cd991989551aac299f3d29
* | | | | | cloud-setup: merge branch 'th/cloud-setup-aliyun-primary-ip'Thomas Haller2022-05-056-66/+159
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=2079849
| * | | | | | cloud-setup: only pass config-iface-data as user-data for async functionsThomas Haller2022-05-052-40/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From config_iface_data->get_config_data we have access to the other pointer already. No need to allocate a user data.
| * | | | | | cloud-setup: use union for NMCSProviderGetConfigIfaceData.privThomas Haller2022-05-052-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a union, it makes more sense. Note that with union, C's struct initialization might not sufficiently set all fields to the default. In practice yes, but theoretically in C a NULL pointer and floats must not have all zero bits, so the following is not guaranteed to work: struct { int some_field; union { void *v_ptr; int v_int; }; } variable = { .some_field = 24, }; assert(variable.union.v_ptr == 0); assert(variable.union.v_int == 0); When initializing the variable, we should not rely on automatically initialize all union members correctly. It cannot at the same time set NULL pointers and zero integers -- well, on our architectures it probably can, but not as far as guaranteed by C language. We need to know which union field we are going to use and initialize it explicitly. As we know the provider type, we can do that. Also, maybe in the future we need special free/unref calls when destroying the type specific data in NMCSProviderGetConfigIfaceData. As we know the provider, we can. Note that having type specific data in NMCSProviderGetConfigIfaceData.priv is a layering violation. But it is still simpler than implementing type specific handlers (callbacks) or tracking the data somewhere else. After all, we know at compile time all the existing provider types.
| * | | | | | cloud-setup: track config-task-data in iface-dataThomas Haller2022-05-056-26/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let NMCSProviderGetConfigIfaceData.get_config_data have a pointer to the NMCSProviderGetConfigTaskData. This will allow two things: - at several places we pass on `nm_utils_user_data_pack(get_config_data, config_iface_data)` as user data. We can avoid that, by just letting config_iface_data have a pointer to get_config_data. - NMCSProviderGetConfigIfaceData contains a provider specific field "priv". That may also require special initialization or destruction, depending on the type. We thus need access to the provider type, which we have via iface_data->get_config_data->self. Also let NMCSProviderGetConfigTaskData have a pointer "self" to the NMCSProvider. While there was already the "task", which contains the provider as source-object, this is more convenient.
| * | | | | | cloud-setup: reorder addresses to honor "primary_ip_address"Thomas Haller2022-05-052-1/+73
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The order of IPv4 addresses matters, in particular if they are in the same subnet. Kernel will mark all but the first one as "secondary". In NetworkManager's ipv4.addresses, the first address is the primary. It seems that on aliyun cloud, "private-ipv4s" URL may give the addresses in arbitrary order. The primary can be fetched from "primary-ip-address". Fix that by also fetching "primary-ip-address". Then, resort the array so that the primary is the first one in the list. https://bugzilla.redhat.com/show_bug.cgi?id=2079849
* | | | | | release: bump version to 1.39.3 (development)1.39.3-devThomas Haller2022-05-042-2/+2
| | | | | |
* | | | | | build/meson: add dependency libnm_client_public_dep for "libnm-client-test"Yi Zhao2022-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix parallel build error: | In file included from ../NetworkManager-1.36.0/src/libnm-client-test/nm-test-utils-impl.c:10: | ../NetworkManager-1.36.0/src/libnm-client-public/NetworkManager.h:47:10: fatal error: nm-enum-types.h: No such file or directory | 47 | #include "nm-enum-types.h" | | ^~~~~~~~~~~~~~~~~ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Fixes: a03a03fbe9a8 ('libnm/tests: add static helper library "src/libnm-client-test/"') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1206
* | | | | | device: merge branch 'bg/enslave-async'Beniamino Galvani2022-05-039-204/+316
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=2052441 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1202
| * | | | | | ovs: add FIXME about cancellable operationsBeniamino Galvani2022-05-031-0/+3
| | | | | | |
| * | | | | | ovs: attach port asynchronouslyBeniamino Galvani2022-05-031-27/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attach operation needs to be asynchronous as we should wait the result from ovsdb. https://bugzilla.redhat.com/show_bug.cgi?id=2052441
| * | | | | | device: make attach_port() asynchronousBeniamino Galvani2022-05-038-55/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some device types the attach-port operation doesn't complete immediately. NMDevice needs to wait that the operation completes before proceeding (for example, before starting stage3 for the port). Change attach_port() so that it can return TERNARY_DEFAULT to indicate that the operation will complete asynchronously. Most of devices are not affected by this and can continue returning TRUE/FALSE as before without callback.
| * | | | | | device: rename {enslave,release}_slave() to {attach,detach}_port()Beniamino Galvani2022-05-038-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the enslave_slave() and release_slave() device methods to attach_port() and detach_port().
| * | | | | | ovsdb: fix memory leakBeniamino Galvani2022-05-031-20/+18
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @error was leaked when created inside the function. While at it, remove the goto. Fixes: 830a5a14cb29 ('device: add support for OpenVSwitch devices')
* | | | | | NEWS: updateThomas Haller2022-05-031-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | Resync latest changes from nm-1-38 branch.
* | | | | | platform: merge branch 'th/platform-address-sync-one-by-one'Thomas Haller2022-05-031-23/+46
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1200