summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm: relax asserting argument for nm_utils_hwaddr_len()th/hwaddr-cleanupThomas Haller2020-09-231-6/+8
| | | | | | | | | | | | | | | | | | | | | nm_utils_hwaddr_len() isn't very useful. It's documented to only accept two possible input values (ARPHRD_ETHER and ARPHRD_INFINIBAND) for which the respective return values are well known. In particular, asserting that the input value is one of the two values means it becomes harder to extend the function (and make it more useful). Because, then the user would need to call: #if NM_VERSION > NM_VERSION_1_XX len = nm_utils_hwaddr_len (ARPHDR_FOO); #else len = 0 #endif and then it would introduce an unnecessary run time dependency on NM_VERSION_1_XX. Instead, just document to return 0 if the value is not supported.
* cloud-setup: add code comment to nmcs_utils_hwaddr_normalize()Thomas Haller2020-09-231-1/+3
|
* shared: move nm_utils_hwaddr_ntoa_buf() to shared/ as _nm_utils_hwaddr_ntoa()Thomas Haller2020-09-235-22/+20
| | | | | The name is better as it mirrors nm_utils_hwaddr_aton(). Also, move it to shared/ so it can be reused (and inlined).
* shared: add _nm_utils_hwaddr_aton() macro (taken from libnm-core)Thomas Haller2020-09-233-40/+37
| | | | | | | | _nm_utils_hwaddr_aton() is only a wrapper around nm_utils_hexstr2bin_full(). But it abstracts the "right" parameter for what we consider a valid MAC address and what not. As such, this macro is useful. Move it to "shared/".
* libnm: cleanup nm_utils_hwaddr_canonical() and nm_utils_hwaddr_valid()Thomas Haller2020-09-231-21/+17
| | | | | | | | | | | | - only call hwaddr_aton() once per function. Also, pass it sizeof(buf) as buffer size, it seems more correct. - the only downside is that we now would always first parse up to 20 characters, before comparing the requested length. Previously, a MAC address that was too long was rejected earlier (and the parsing aborted earlier). But that is a tiny overhead, also we expect that in common cases the MAC addresses are in fact of the right size, then there is no difference.
* all: require a semicolon after NM_CACHED_QUARK_FCN()Thomas Haller2020-09-2310-19/+19
|
* clang-format: proposed styleAntonio Cardace2020-09-231-2/+2
|
* contrib/release: implement "rc1" release modeThomas Haller2020-09-231-19/+71
|
* libnm: hide nm_setting_ip_config_next_valid_dns_option() function from headersThomas Haller2020-09-223-4/+3
| | | | | | | | | | | | | nm_setting_ip_config_next_valid_dns_option() API was added in libnm 1.2, but it was never exported in the ABI of libnm. It thus was unusable, and any user trying to link against it would have been unable to do so. Hide the API now entirely. It doesn't seem a very nice API. If we want to allow the user to validate option names, we should expose such a function to validate an option (not to fetch the next valid option from a profile). Fixes: 019943bb5d9e ('libnm-core: add dns-options property to NMSettingIPConfig')
* shared: extend nm_utils_hexstr2bin_full() to require hexdigits in pairsThomas Haller2020-09-228-8/+67
| | | | | | | | | nm_utils_hexstr2bin_full() is our general hexstr to binary parsing method. It uses (either mandatory or optional) delimiters. Before, if delimiters are in use, it would accept individual hexdigits. E.g. "a:b" would be accepted as "0a:0b:. Add an argument that prevents accepting such single digits.
* po: correct Chinese translationvb/mr-testingletmestudy2020-09-211-1/+1
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/628
* license: add SUSE LLC to RELICENSE.mdThomas Haller2020-09-181-3/+3
| | | | | | | This also includes the contributions made by Ximian (bought by Novell) and by Novell. https://mail.gnome.org/archives/networkmanager-list/2020-September/msg00000.html
* l3cfg: merge branch 'th/l3cfg-9'Thomas Haller2020-09-1819-149/+709
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/626
| * core: assert that nm_dbus_utils_get_property() returns a variant of the ↵Thomas Haller2020-09-181-4/+18
| | | | | | | | | | | | | | | | | | expected type g_dbus_gvalue_to_gvariant() doesn't check/assert that the value has the right variant signature, if the value is already a GVariant. Add an assertion.
| * core: fix D-Bus type for "org.freedesktop.NetworkManager.Capabilities" propertyThomas Haller2020-09-181-1/+1
| | | | | | | | Fixes: 297d4985abcc ('core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API')
| * device: return same singleton variant for NM_DEVICE_IP4_ADDRESS propertyThomas Haller2020-09-181-5/+6
| | | | | | | | | | All our devices will return the same value on D-Bus: a "u" variant with zero value. Since NMDBusObject caches all the property values, we can share the instance.
| * shared: add m_g_variant_singleton_u_0()Thomas Haller2020-09-182-0/+30
| | | | | | | | | | | | | | | | | | We anyway cache our variants for the properties of NMDBusObject instances. If such a variant is well known to be always the same, there is no need to allocate a new instance every time. In particular, because GVariant is an immutable and ref counted type. Add a singleton getter for a "u" variant with numeric value 0.
| * device: break deprecated "Ip4Address" D-Bus property of Device interfaceThomas Haller2020-09-183-33/+4
| | | | | | | | | | | | | | | | | | The "Ip4Address" property of "org.freedesktop.NetworkManager.Device" interface is deprecated since version 0.9.9.1 (2013). Also, the property is not exposed by libnm and generally not useful. Drop the code to maintain it. The property still exists but always returns 0 (0.0.0.0).
| * l3cd/ndisc: add nm_ndisc_data_to_l3cd() helperThomas Haller2020-09-152-0/+129
| | | | | | | | | | | | | | | | | | NML3ConfigData is a simple container structure that contains no logic. Also, DHCP code already is intimately related to NMIP[46]Config (for now, later that will be NML3ConfigData). It makes sense that NMNDisc is aware of NML3ConfigData and knows how to conver the RA data into an l3cd instance.
| * l3cfg: add nm_l3_config_data_clear_searches() APIThomas Haller2020-09-152-4/+20
| |
| * l3cfg: add nm_l3_config_data_{get,set}_ip6_mtu() APIThomas Haller2020-09-153-0/+33
| |
| * l3cfg: add nm_l3_config_data_{get,set}_ndisc_*() APIThomas Haller2020-09-153-11/+143
| |
| * l3cfg: fix handling of mtu during nm_l3_config_data_merge()Thomas Haller2020-09-151-1/+1
| | | | | | | | Fixes: 25d404dadb04 ('l3cfg: add more API to NML3ConfigData')
| * l3cfg: track ip6_privacy (use_tempaddr) in NML3ConfigDataThomas Haller2020-09-153-0/+39
| | | | | | | | | | | | NMDevice currently configures use_tempaddr sysctl itself. Later, NML3Cfg should do that, so we need to keep track of that as part of the configuration.
| * device/ndisc: explicitly call nm_ndisc_stop() during addrconf6_cleanup()Thomas Haller2020-09-151-1/+4
| |
| * device/ndisc: add nm_ndisc_stop() methodThomas Haller2020-09-154-21/+94
| | | | | | | | | | | | | | | | | | It is bad style to rely on the last unref of an object for stopping the operation. With a ref-counted object you should never rely on anybody else still having (or not having) a reference. Hence, you should not rely on stopping the ND during the last unref. Add an explicit nm_ndisc_stop() function.
| * device/ndisc: let calling code determine the used RA timeout for NMNDiscThomas Haller2020-09-158-62/+179
| | | | | | | | | | | | | | | | | | | | Previously, if we passed ra_timeout 0 to NMNDisc, then it would calculate the effective timeout based on the router-solicitations and the router-solicitation-interval. The caller may want to know the used timeout, to also run its own timers with the same timeout. Hence, it cannot leave this automatism internal to NMNDisc.
| * libnm: mark static buffer for nm_utils_inet[46]_ntop() as thread localThomas Haller2020-09-151-5/+7
| | | | | | | | | | | | I think the convenience feature about omitting the output buffer is undesirable. Anyway, try to make it safer by using a thread local buffer.
| * core: use _nm_utils_inet4_ntop() instead of nm_utils_inet4_ntop()Thomas Haller2020-09-152-3/+3
|/ | | | | | nm_utils_inet4_ntop() is public API of libnm. Also, it accepts a %NULL buffer to use a static buffer. That is error prone and we should not use such convenience behavior for our own code.
* supplicant: fix crash in _scan_notify_allowed() when supplicant disconnectsThomas Haller2020-09-151-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When stopping wpa_supplicant, I got an assertion failure: #0 g_logv (log_domain=0x55f8e4a43013 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1377 #1 0x00007f2d33245233 in g_log (log_domain=log_domain@entry=0x55f8e4a43013 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f2d332976ff "%s: assertion '%s' failed") at ../glib/gmessages.c:1415 #2 0x00007f2d33245a2d in g_return_if_fail_warning (log_domain=log_domain@entry=0x55f8e4a43013 "NetworkManager", pretty_function=pretty_function@entry=0x55f8e4acc1e0 <__func__.14> "nm_supplicant_interface_get_state", expression=expression@entry=0x55f8e4acb450 "NM_IS_SUPPLICANT_INTERFACE (self)") at ../glib/gmessages.c:2771 #3 0x000055f8e49ab3f2 in nm_supplicant_interface_get_state (self=0x0) at src/supplicant/nm-supplicant-interface.c:2581 #4 0x00007f2d1f7307a4 in _scan_notify_allowed (self=self@entry=0x55f8e5199cf0 [NMDeviceWifi], do_kickoff=do_kickoff@entry=NM_TERNARY_FALSE) at src/devices/wifi/nm-device-wifi.c:514 #5 0x00007f2d1f730ed3 in supplicant_iface_state (self=0x55f8e5199cf0 [NMDeviceWifi], new_state=<optimized out>, old_state=NM_SUPPLICANT_INTERFACE_STATE_COMPLETED, disconnect_reason=<optimized out>, is_real_signal=<optimized out>) at src/devices/wifi/nm-device-wifi.c:2492 #6 0x00007f2d32339af0 in ffi_call_unix64 () at ../src/x86/unix64.S:76 #7 0x00007f2d323392ab in ffi_call (cif=cif@entry=0x7ffcaf6c3120, fn=fn@entry=0x7f2d1f731920 <supplicant_iface_state_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7ffcaf6c3050) at ../src/x86/ffi64.c:525 #12 0x00007f2d3334ac63 in <emit signal ??? on instance 0x55f8e4f49bb0 [NMSupplicantInterface]> (instance=instance@entry=0x55f8e4f49bb0, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3554 #8 0x00007f2d3333238d in g_cclosure_marshal_generic (closure=closure@entry=0x55f8e521eb10, return_gvalue=return_gvalue@entry=0x0, n_param_values=n_param_values@entry=4, param_values=param_values@entry=0x7ffcaf6c3320, invocation_hint=invocation_hint@entry=0x7ffcaf6c32a0, marshal_data=marshal_data@entry=0x0) at ../gobject/gclosure.c:1500 #9 0x00007f2d3333188a in g_closure_invoke (closure=0x55f8e521eb10, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7ffcaf6c3320, invocation_hint=invocation_hint@entry=0x7ffcaf6c32a0) at ../gobject/gclosure.c:810 #10 0x00007f2d33344423 in signal_emit_unlocked_R (node=node@entry=0x7f2d200066c0, detail=detail@entry=0, instance=instance@entry=0x55f8e4f49bb0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffcaf6c3320) at ../gobject/gsignal.c:3742 #11 0x00007f2d3334aaf9 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffcaf6c34f0) at ../gobject/gsignal.c:3498 #13 0x000055f8e49a880b in _emit_signal_state (disconnect_reason=0, old_state=NM_SUPPLICANT_INTERFACE_STATE_COMPLETED, new_state=<optimized out>, self=0x55f8e4f49bb0 [NMSupplicantInterface]) at src/supplicant/nm-supplicant-interface.c:1083 #14 set_state_down (self=0x55f8e4f49bb0 [NMSupplicantInterface], force_remove_from_supplicant=0, reason=0x55f8e4acd918 "InterfaceRemoved signal from wpa_supplicant") at src/supplicant/nm-supplicant-interface.c:1083 #15 0x000055f8e49acb0b in _supp_iface_remove_one (self=0x55f8e51990c0 [NMSupplicantManager], supp_iface=0x55f8e4f49bb0 [NMSupplicantInterface], force_remove_from_supplicant=0, reason=0x55f8e4acd918 "InterfaceRemoved signal from wpa_supplicant") at src/supplicant/nm-supplicant-manager.c:1067 #16 0x000055f8e49accec in _dbus_interface_removed_cb (connection=<optimized out>, sender_name=0x7f2d20038f20 ":1.4741", object_path=<optimized out>, signal_interface_name=<optimized out>, signal_name=<optimized out>, parameters=<optimized out>, user_data=0x55f8e51990c0) at src/supplicant/nm-supplicant-manager.c:902 #17 0x00007f2d33483c0f in emit_signal_instance_in_idle_cb (data=data@entry=0x7f2d20034750) at ../gio/gdbusconnection.c:3777 #18 0x00007f2d3323945b in g_idle_dispatch (source=source@entry=0x7f2d20038db0, callback=0x7f2d33483b90 <emit_signal_instance_in_idle_cb>, user_data=0x7f2d20034750) at ../glib/gmain.c:5755 #19 0x00007f2d3323d78f in g_main_dispatch (context=0x55f8e4ee31e0) at ../glib/gmain.c:3309 #20 g_main_context_dispatch (context=0x55f8e4ee31e0) at ../glib/gmain.c:3974 #21 0x00007f2d3323db18 in g_main_context_iterate (context=0x55f8e4ee31e0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4047 #22 0x00007f2d3323de33 in g_main_loop_run (loop=0x55f8e4ec4d20) at ../glib/gmain.c:4241 #23 0x000055f8e4755a3b in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:456 Fixes: 7500e90b533f ('wifi: rework scanning of Wi-Fi device')
* platform: add support for mcast_hash_max netlink attribute for bridgesSayed Shah2020-09-156-0/+21
| | | | | | Adding the mcast_hash_max property. The value must be the power of 2. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/624
* device: merge branch 'th/device-track-shared-ips'Thomas Haller2020-09-153-37/+133
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/625
| * device: track used shared-ips via NMNetnsth/device-track-shared-ipsThomas Haller2020-09-141-37/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that when NetworkManager tries to allocate more than 256 networks, then previously the allocation would fail. We no longer fail, but log an error and reuse the last address (10.42.255.1/24). It's simpler to have code that cannot fail, because it's often hard to handle failure properly. Also, if the user would configure two shared profiles that explicitly use the same subnet, we also wouldn't fail. Why not? Is that not a problem as well? If it is not, there is no need to fail in this case. If it is a problem, then it would be much more important to handle this case otherwise -- since it's more likely to activate two profiles that accidentally use the same subnet than activating 257+ shared profiles.
| * core: add nm_netns_shared_ip_reserve() APIThomas Haller2020-09-142-0/+120
|/ | | | | | | | Add a better way of tracking the shared IP addresses that are in use. This will replace NMDevice's usage of a global hash table. For one, the API is more formalized with reserve() and release() functions. Also, it ties the used IP addresses to the netns, which would be more correct (in the future when we may support more netns).
* contrib/build: reword howto for "release.sh" scriptThomas Haller2020-09-141-3/+4
|
* release: bump version to 1.27.3 (development)1.27.3-devBeniamino Galvani2020-09-142-2/+2
|
* libnm/doc: improve description for ipv[46].dns-priority and ↵Thomas Haller2020-09-142-28/+50
| | | | ipv[46].dns-search regarding DNS leaks
* l3cfg: merge branch 'th/l3cfg-8'Thomas Haller2020-09-1121-1299/+1915
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/623
| * device/trivial: move code aroundThomas Haller2020-09-111-1074/+1070
| |
| * platform: add nm_platform_iter_obj_for_each() macroThomas Haller2020-09-111-0/+5
| |
| * core: use nm_platform_ip6_address_match() in nm_ip6_config_find_first_address()Thomas Haller2020-09-111-23/+2
| |
| * platform: add nm_platform_ip6_address_match()Thomas Haller2020-09-112-0/+37
| |
| * dhcp: drop "event_id" parameter from NM_DHCP_CLIENT_SIGNAL_STATE_CHANGED signalThomas Haller2020-09-116-23/+42
| | | | | | | | | | | | It is solely computed from the lease information (the GHashTable). No need to pass it along as separate argument in NM_DHCP_CLIENT_SIGNAL_STATE_CHANGED, especially since it only applies to IPv6.
| * device: mark NMDevicePrivate.sys_iface_state as constThomas Haller2020-09-112-5/+8
| | | | | | | | | | | | It's important to find place in code where are field (state) gets mutated. Make sys_iface_state field const, but add a mutable alias via a union. You can now grep for places that change the field.
| * device/trivial: unify (rename) functions in "nm-device.c"Thomas Haller2020-09-111-71/+71
| |
| * core: move nm_utils_generate_duid_from_machine_id() to "nm-core-utils.c"Thomas Haller2020-09-113-116/+138
| |
| * l3cfg: add nm_l3cfg_get_combined_l3cd() functionThomas Haller2020-09-112-0/+10
| |
| * l3cfg: gracefully accept %NULL argument in nm_l3_config_data_lookup_objs()Thomas Haller2020-09-111-0/+2
| | | | | | | | | | | | This way we can safely iterate over a %NULL instance with nm_l3_config_data_iter_obj_for_each(). This avoids a NULL check, which in this case seems more annoying than helpful.
| * l3cfg: add nm_l3cfg_get_best_default_route() functionThomas Haller2020-09-112-0/+25
| | | | | | | | | | | | This is the best default route that we commited the last time (if any). It may not reflect what is currently configured (in NMPlatform) and it may not reflect the latest changes since nm_l3cfg_add_config().
| * l3cfg: add nm_l3cfg_get_pllink() helperThomas Haller2020-09-111-0/+22
| | | | | | | | | | | | NML3Cfg already keeps track of the current NMPlatformLink object. Allow accessing it directly from an NML3Cfg instance, which saves a cache lookup from NMPlatform.