summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* WIP: manager: merge in connection defaults on AddAndActivatelr/conn-defaultsLubomir Rintel2023-03-161-7/+9
|
* WIP: config-data: add a routine that extends a variant from users with defaultsLubomir Rintel2023-03-162-0/+151
| | | | | | | TODO: this uses the dbus setting/property names; that is "802-11-wireless.assigned-mac-address" instead of "wifi.cloned-mac-address", which is stupid wrong and possibly immoral. Fix it.
* WIP: config-data: add on-add-and-activate= to [connection*]Lubomir Rintel2023-03-162-3/+18
| | | | | | | | | | | | | | This marks the [connection*] section as taking effect on connection being added with AddAndActivate as opposed to impacting the existing connections. [connection.wifi] match-device=type:wifi on-add-and-activate=yes 802-11-wireless.assigned-mac-address=stable TODO: document, figure out if this is a good idea, make it suck less if possible
* WIP: config-data: factor out traversing connection/device match sectionsLubomir Rintel2023-03-161-29/+53
|
* WIP: manager: check device path on AddAndActivateLubomir Rintel2023-03-161-0/+11
| | | | | | | | validate_activation_request() just acts as if a no device was passed if nm_manager_get_device_by_path() can't resolve the path into a NMDevice. That means a bogus path name is silently ignored. TODO: Check if that's indeed the case
* manager: error out on wrong connection passed to AddAndActivateLubomir Rintel2023-03-161-5/+8
|
* release: improve hint about documentation in "release.sh"Thomas Haller2023-03-091-0/+1
| | | | | | A "minor" release can still be the latest release. It depends on which minor release you do. The script isn't smart enough to understand the difference, so make the hint a bit clearer.
* release: fix honoring $ORIGIN environment variableThomas Haller2023-03-091-2/+3
|
* core: fix constructing the IP4Config.Nameservers propertyHaochen Tong2023-03-091-1/+1
| | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1563 Fixes: c68e148b027e ('core: extend NML3ConfigData:nameserver to track DNS as string')
* glib-aux: ensure alignment for nm_ether_addr_zeroThomas Haller2023-03-082-1/+6
| | | | | | | | | | In practice, this does not cause an issue, because NMEtherAddr quite quite obviously only contains uint8 values and has alignment 1. It's still ugly to case nm_ip_addr_zero to NMEtherAddr if they are entirely unrelated types. Fixes: 58e2ba053535 ('glib-aux: drop ethernet fields from NMIPAddr union')
* glib-aux: drop unused union field NMIPAddr.arrayThomas Haller2023-03-082-6/+5
| | | | There is already "addr_ptr" with the same purpose.
* glib-aux: make NMIPAddr a plain unionThomas Haller2023-03-082-10/+8
| | | | | | | | | It is slightly confusing to be required to be aware whether something is a union or a struct. Hence, the union was wrapped in a struct. However, we anyway almost always use the typedef NMIPAddr. The single place where we forward declare the type, we can correctly use the union specifier.
* glib-aux: remove duplicate forward declartion of nm_ip_addr_zeroThomas Haller2023-03-081-4/+1
|
* glib-aux: drop ethernet fields from NMIPAddr unionThomas Haller2023-03-081-8/+1
| | | | | | | | | It's not really used anyway. The idea was, that the ethernet MAC address would fit from the size, and we might at a few places use that for convenience. But it's more confusing. Also, because there is already NMEtherAddr and `struct ether_addr`.
* all: merge branch 'th/platform-rt-prefsrc' (part 1)Thomas Haller2023-03-087-13/+31
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1550
| * all: use c_list_is_empty_or_single() where appropriateThomas Haller2023-03-083-4/+5
| |
| * std-aux: add c_list_is_empty_or_single() helperThomas Haller2023-03-082-0/+14
| | | | | | | | | | | | | | | | | | Having a list with only one element is often interesting to know. For example, if you are about to unlink an element, you may want to check whether afterwards the list is empty. Add c_list_is_empty_or_single() for that. It is probably more efficient than plain c_list_length_is(list, 1) and also a better name.
| * glib-aux: make _LOGT_ENABLED()/_LOGD_ENABLED() as G_UNLIKELY()Thomas Haller2023-03-081-9/+9
| |
| * std-aux/trivial: add code comment to NM_IS_IPv4()Thomas Haller2023-03-081-0/+3
|/
* release: bump version to 1.43.3 (development)1.43.3-devLubomir Rintel2023-03-082-2/+2
|
* merge: branch 'ff/fix_networking_off'Fernando Fernandez Mancera2023-03-084-21/+36
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1512
| * devices: drop wrong assertion on parent when ifindex is not presentff/fix_networking_offFernando Fernandez Mancera2023-03-082-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a parent dependent device it can have software device as parent without an ifindex. In that case, it will fail on an ssertion on parent being missing. In order to avoid this, we are handling the situation similar to what we do for VLAN devices. NetworkManager will raise different error and block the autoconnection instead of asserting. This solves the assert error for the following commands: ``` nmcli connection add type macvlan ifname mv1 con-name mv1+ macvlan.parent dummy0 mode vepa nmcli connection add type dummy ifname dummy0 con-name dummy0+ autoconnect no ```
| * core: set STATE_REASON_CONNECTION_ASSUMED when waking upFernando Fernandez Mancera2023-03-081-1/+1
| | | | | | | | Otherwise, external devices become managed and we clear IP addresses.
| * device: always queue recheck_assume before making device managedFernando Fernandez Mancera2023-03-081-13/+9
| | | | | | | | | | | | There were a few places where we did already this but there was one place where we missed it, in nm-manager.c:do_sleep_wake(). Therefore, the device end in DISCONNECTED state and did not assume the connection.
| * device: do cleanup type removed if sys-iface-state is REMOVEDFernando Fernandez Mancera2023-03-081-1/+4
|/ | | | | | | When the state is DISCONNECTED is being set from a configuring/configured state we might want to always DECONFIGURE the interface (ifindex, ip addresses, routes..) except if the sys-iface-state is REMOVED in that case we would like to remove it.
* merge: branch 'lr/aws-ec2-idms2'Lubomir Rintel2023-03-087-146/+224
|\ | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1547 https://bugzilla.redhat.com/show_bug.cgi?id=2151986
| * cloud-setup/ec2: start with requesting a IMDSv2 tokenlr/aws-ec2-idms2Lubomir Rintel2023-03-071-20/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The present version of the EC2 metadata API (IMDSv2) requires a header with a token to be present in all requests. The token is essentially a cookie that's not actually a cookie that's obtained with a PUT call that doesn't put anything. Apparently it's too easy to trick someone into calling a GET method. EC2 now supports IMDSv2 everywhere with IMDSv1 being optional, so let's just use IMDSv2 unconditionally. Also, the presence of a token API can be used to detect the AWS EC2 cloud. https://bugzilla.redhat.com/show_bug.cgi?id=2151986
| * cloud-setup: document detect() and get_config() methodsLubomir Rintel2023-03-071-0/+28
| | | | | | | | | | | | | | Clarify that detect() needs to succeed before get_config(). I thought it's sort of common sense, but it's better to be explicit as we're going to rely on that.
| * cloud-setup: make nm_http_client_req() accept a method argumentLubomir Rintel2023-03-076-0/+31
| | | | | | | | We'll need to be able to issue PUT calls.
| * cloud-setup: rename get/Get identifiers to req and ReqLubomir Rintel2023-03-076-114/+114
| | | | | | | | | | We're going to extend those to issue methods other than GET. Also, "request" would've been too long, "req" looks nicer.
| * cloud_setup: unexport nm_http_client_get()Lubomir Rintel2023-03-072-17/+2
| | | | | | | | It's not used anywhere.
* | contrib: update history and hints in "nm-in-container.sh" scriptThomas Haller2023-03-081-3/+3
| | | | | | | | | | Calling `nm-env-prepare.sh --prefix eth -i 1 && nmcli device connect eth1` has a race, where NetworkManager didn't see the interface yet. Add a sleep.
* | libnm/docs: mention "ipv[46].dhcp-iaid=stable" to be affected by ↵Thomas Haller2023-03-083-8/+9
| | | | | | | | "connection.stable-id"
* | nmcli: set LESSSECURE=1 (unless already set)Lubomir Rintel2023-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, the pager being able to execute commands takes some people by surprpise, making their poor configuration choices have consequences. Let's pray for some mercy on their souls with the LESSECURE variable, which makes less less likely to conduct evil deeds. Systemd also deals with this, but being systemd they make it as complicated as possible. We just set it unconditionally, hoping nobody wanted the extra functionality and they're in only for the scrolling. If anyone minds they can just set LESSSECURE=0 and we'll leave it alone. See also: SYSTEMD_PAGERSECURE in systemctl(1) manual. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1559
* | build: fix pretty() sed invocation portability in .ver scriptDaniel Kolesa2023-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The `\0` being used to refer to the whole match is a GNU extension. On other implementations of sed, this will simply replace the each matched line with ` 0;`, resulting in symbols being missing in the NetworkManager executable, which breaks the wifi plugin and others. Use `&` instead, which behaves as expected in all implementations. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1562
* | merge: branch 'ff/new_bond_options'Fernando Fernandez Mancera2023-03-0613-52/+273
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1553
| * | bonding: add support to ns_ip6_target optionff/new_bond_optionsFernando Fernandez Mancera2023-03-0611-50/+157
| | | | | | | | | | | | | | | | | | This is the IPv6 equivalent of arp_ip_target option. It requires arp_interval set and allow the user to specify up to 16 IPv6 addresses as targets. By default, the list is empty.
| * | netlink: introduce nla_get_in6_addr() helperFernando Fernandez Mancera2023-03-061-0/+11
| | |
| * | bonding: add support to lacp_active optionFernando Fernandez Mancera2023-03-068-4/+75
| | | | | | | | | | | | | | | | | | The valid values for this option are 0 (off) and 1 (on). By default the value is 1 (on). Please notice that this option is only compatible with 802.3AD mode.
| * | bonding: add support to arp_missed_max optionFernando Fernandez Mancera2023-03-067-2/+34
| | | | | | | | | | | | | | | | | | The new arp_missed_max option valid range is 0-255 where value 0 means not set. Please notice that this option is not compatible with 802.3AD, balance-tlb and balance-alb modes.
| * | platform: compare arp_ip_targets_num before arp_ip_target valuesFernando Fernandez Mancera2023-03-061-1/+1
|/ / | | | | | | | | | | | | | | We must first check whether a->arp_ip_targets_num and b->arp_ip_targets_num are identical. Otherwise, this accesses potentially uninitialized values. Fixes: f900f7bc2c52 ('platform: add netlink support for bond link')
* | core: fix crash when reloading global dns configurationBeniamino Galvani2023-03-061-11/+13
|/ | | | | | | | | | | | | | | | | | | | | | | | | When reloading the configuration and there is a global DNS configuration without domains, NM crashes in global_dns_equal() because `old->domains` and `new->domains` are both NULL. Fix that. Thread 1 "NetworkManager" received signal SIGTRAP, Trace/breakpoint trap. 0 g_logv (log_domain=0x7fe81a2110be "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1433 1 g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at ../glib/gmessages.c:1471 2 g_hash_table_size (hash_table=<optimized out>) at ../glib/ghash.c:2183 3 g_hash_table_size (hash_table=<optimized out>) at ../glib/ghash.c:2181 4 global_dns_equal (new=0xecc540, old=0xe618e0) at ../src/core/nm-config-data.c:1466 5 nm_config_data_diff (old_data=old_data@entry=0xe60020, new_data=new_data@entry=0xe606a0) at ../src/core/nm-config-data.c:1946 6 _set_config_data (self=0xe45810, new_data=0xe606a0, reload_flags=NM_CONFIG_CHANGE_CAUSE_SIGHUP) at ../src/core/nm-config.c:2923 7 nm_config_reload (self=0xe45810, reload_flags=NM_CONFIG_CHANGE_CAUSE_SIGHUP, emit_warnings=emit_warnings@entry=1) at ../src/core/nm-config.c:2875 8 nm_main_config_reload (signal=<optimized out>) at ../src/core/main.c:141 9 sighup_handler (user_data=<optimized out>) at ../src/core/main-utils.c:26 10 g_main_dispatch (context=0xe619e0) at ../glib/gmain.c:3444 11 g_main_context_dispatch (context=0xe619e0) at ../glib/gmain.c:4162 12 g_main_context_iterate.constprop.0 (context=0xe619e0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4238 13 g_main_loop_run (loop=0xe5e310) at ../glib/gmain.c:4438 14 main (argc=<optimized out>, argv=<optimized out>) at ../src/core/main.c:515 Fixes: 1f0d1d78d2a2 ('dns-manager: always apply options from [global-dns]')
* po/ca: fixes to Catalan translationJordi Mas2023-03-061-7/+7
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1556
* connectivity: avoid uninitialized variable warning in ↵Thomas Haller2023-03-031-12/+6
| | | | | | | | | | | | | | | | | nm_connectivity_check_start() In file included from ./src/libnm-std-aux/nm-default-std.h:102, from ./src/libnm-glib-aux/nm-default-glib.h:11, from ./src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13, from ./src/core/nm-default-daemon.h:11, from src/core/nm-connectivity.c:8: src/core/nm-connectivity.c: In function ‘nm_connectivity_check_start’: ./src/libnm-std-aux/nm-std-aux.h:180:12: error: ‘reason’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (expr) \ ^ src/core/nm-connectivity.c:1055:29: note: ‘reason’ was declared here const char *reason; ^~~~~~
* platform/tests: avoid accessing in_addr_t via NMIPAddr unionThomas Haller2023-03-031-2/+6
| | | | | | | | | | | | | | | | | | The compiler may dislike this: CC src/core/platform/tests/libNetworkManagerTest_la-test-common.lo In function '_ip_address_add', inlined from 'nmtstp_ip4_address_add' at ../src/core/platform/tests/test-common.c:1892:5: ../src/core/platform/tests/test-common.c:1807:63: error: array subscript 'NMIPAddr {aka const struct _NMIPAddr}[0]' is partly outside array bounds of 'in_addr_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds] 1807 | peer_address->addr4, | ~~~~~~~~~~~~^~~~~~~ ../src/core/platform/tests/test-common.c: In function 'nmtstp_ip4_address_add': ../src/core/platform/tests/test-common.c:1886:36: note: object 'peer_address' of size 4 1886 | in_addr_t peer_address, | ~~~~~~~~~~~~^~~~~~~~~~~~ ... Fixes: 06aafabf14e6 ('platform/test: add test adding IPv4 addresses that only differ by their peer-address')
* contrib: install more packages in "nm-in-container.sh"Thomas Haller2023-03-031-0/+3
|
* merge: branch 'bg/dnsmasq-global-conf'Beniamino Galvani2023-03-032-7/+13
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1555
| * man: update documentation about global DNS configurationbg/dnsmasq-global-confBeniamino Galvani2023-03-031-6/+11
| | | | | | | | | | | | | | | | | | Now the settings in the [global-dns] section are used *in addition* to connection-specific ones. Only the global domains sections, when valid, override connection settings. Update the man page to clarify that. Fixes: 1f0d1d78d2a2 ('dns-manager: always apply options from [global-dns]')
| * dnsmasq: process both global and per-device configurationBeniamino Galvani2023-03-031-1/+2
|/ | | | | | | | | The global configuration now can be valid when there are no global domains defined. The dnsmasq backend must process it and then, if there is no global default domain, also process the per-connection settings. Fixes: 1f0d1d78d2a2 ('dns-manager: always apply options from [global-dns]')
* contrib: add usage comment to "git-subtree-reimport.sh"Thomas Haller2023-03-031-0/+9
|