summaryrefslogtreecommitdiff
path: root/shared
Commit message (Collapse)AuthorAgeFilesLines
* all: use wrappers for g_ascii_strtoll(), g_ascii_strtoull(), g_ascii_strtod()th/strtoll-workaroundThomas Haller2020-04-011-21/+5
| | | | | | | | | | | | | | | | | | | | | | | Sometimes these function may set errno to unexpected values like EAGAIN. This causes confusion. Avoid that by using our own wrappers that retry in that case. For example, in rhbz#1797915 we have failures like: errno = 0; v = g_ascii_strtoll ("10", 0, &end); if (errno != 0) g_assert_not_reached (); as g_ascii_strtoll() would return 10, but also set errno to EAGAIN. Work around that by using wrapper functions that retry. This certainly should be fixed in glib (or glibc), but the issues are severe enough to warrant a workaround. Note that our workarounds are very defensive. We only retry 2 times, if we get an unexpected errno value. This is in the hope to recover from a spurious EAGAIN. It won't recover from other errors. https://bugzilla.redhat.com/show_bug.cgi?id=1797915
* shared: add nm_g_ascii_strtoull() to workaround bugThomas Haller2020-04-012-0/+53
|
* shared: add nm_g_ascii_strtod() to workaround bugThomas Haller2020-04-012-0/+40
|
* shared: add nm_g_ascii_strtoll() to workaround bugThomas Haller2020-04-012-0/+70
|
* shared: add assertions to _parse_legacy_addr4() and ↵Thomas Haller2020-03-311-2/+23
| | | | | | | | _nm_utils_ascii_str_to_int64() Add more assertion for hunting down assertion failure at [1]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1797915
* meson: merge branch 'inigomartinez/meson-license'Thomas Haller2020-03-2814-0/+28
|\ | | | | | | | | | | | | | | | | | | Add SPDX license headers for meson files. As far as I can tell, according to RELICENSE.md file, almost everybody who contributed to the meson files agreed to the LGPL-2.1+ licensing. This entails the vast majority of code in question. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/397
| * license: Add license using SPDX identifiers to meson build filesIñigo Martínez2020-02-1714-0/+28
| | | | | | | | | | License is missing in meson build files. This has been added using SPDX identifiers and licensed under LGPL-2.1+.
* | tests: replace NMTST_SWAP() by new NM_SWAP() macroThomas Haller2020-03-262-12/+3
| | | | | | | | | | | | | | NMTST_SWAP() used memcpy() for copying the value, while NM_SWAP() uses a temporary variable with typeof(). I think the latter is preferable. Also, the macro is essentially doing the same thing.
* | shared: add NM_SWAP() macroThomas Haller2020-03-261-0/+11
| |
* | shared: add NM_ASCII_WHITESPACES macroThomas Haller2020-03-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NM_ASCII_SPACES contains the ASCII characters according to g_ascii_isspace(). Add NM_ASCII_WHITESPACES which differs from NM_ASCII_SPACES by not including "\f". In some cases, that character shall be excluded. For example, this is what systemd uses as "WHITESPACE" define at various places. Also, reorder the spaces string so that plain space comes first. It is expected that ' ' is much more frequently than newlines or tabs. While the order here shouldn't matter, it seems preferably to order frequent characters in front.
* | systemd: merge branch systemd into masterThomas Haller2020-03-2330-504/+1004
|\ \
| * | systemd: update code from upstream (2020-03-23)Thomas Haller2020-03-2329-500/+995
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=cdc6c95737d26b1746b446dfe662872d593d23c6 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files -z :/src/systemd/src/ \ :/shared/systemd/src/ \ :/shared/nm-std-aux/unaligned.h | \ xargs -0 rm -f nm_copy_sd_shared() { mkdir -p "./shared/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./shared/systemd/$1" } nm_copy_sd_core() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_stdaux() { mkdir -p "./shared/nm-std-aux/" cp "$SYSTEMD_DIR/$1" "./shared/nm-std-aux/${1##*/}" } nm_copy_sd_core "src/libsystemd-network/arp-util.c" nm_copy_sd_core "src/libsystemd-network/arp-util.h" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c" nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd_core "src/libsystemd-network/lldp-internal.h" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd_core "src/libsystemd-network/lldp-network.c" nm_copy_sd_core "src/libsystemd-network/lldp-network.h" nm_copy_sd_core "src/libsystemd-network/network-internal.c" nm_copy_sd_core "src/libsystemd-network/network-internal.h" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd_core "src/libsystemd-network/sd-lldp.c" nm_copy_sd_core "src/libsystemd/sd-event/event-source.h" nm_copy_sd_core "src/libsystemd/sd-event/event-util.c" nm_copy_sd_core "src/libsystemd/sd-event/event-util.h" nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd_core "src/systemd/_sd-common.h" nm_copy_sd_core "src/systemd/sd-dhcp-client.h" nm_copy_sd_core "src/systemd/sd-dhcp-lease.h" nm_copy_sd_core "src/systemd/sd-dhcp-option.h" nm_copy_sd_core "src/systemd/sd-dhcp6-client.h" nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h" nm_copy_sd_core "src/systemd/sd-event.h" nm_copy_sd_core "src/systemd/sd-id128.h" nm_copy_sd_core "src/systemd/sd-ipv4acd.h" nm_copy_sd_core "src/systemd/sd-ipv4ll.h" nm_copy_sd_core "src/systemd/sd-lldp.h" nm_copy_sd_core "src/systemd/sd-ndisc.h" nm_copy_sd_shared "src/basic/alloc-util.c" nm_copy_sd_shared "src/basic/alloc-util.h" nm_copy_sd_shared "src/basic/async.h" nm_copy_sd_shared "src/basic/cgroup-util.h" nm_copy_sd_shared "src/basic/env-file.c" nm_copy_sd_shared "src/basic/env-file.h" nm_copy_sd_shared "src/basic/env-util.c" nm_copy_sd_shared "src/basic/env-util.h" nm_copy_sd_shared "src/basic/errno-util.h" nm_copy_sd_shared "src/basic/escape.c" nm_copy_sd_shared "src/basic/escape.h" nm_copy_sd_shared "src/basic/ether-addr-util.c" nm_copy_sd_shared "src/basic/ether-addr-util.h" nm_copy_sd_shared "src/basic/extract-word.c" nm_copy_sd_shared "src/basic/extract-word.h" nm_copy_sd_shared "src/basic/fd-util.c" nm_copy_sd_shared "src/basic/fd-util.h" nm_copy_sd_shared "src/basic/fileio.c" nm_copy_sd_shared "src/basic/fileio.h" nm_copy_sd_shared "src/basic/format-util.c" nm_copy_sd_shared "src/basic/format-util.h" nm_copy_sd_shared "src/basic/fs-util.c" nm_copy_sd_shared "src/basic/fs-util.h" nm_copy_sd_shared "src/basic/hash-funcs.c" nm_copy_sd_shared "src/basic/hash-funcs.h" nm_copy_sd_shared "src/basic/hashmap.c" nm_copy_sd_shared "src/basic/hashmap.h" nm_copy_sd_shared "src/basic/hexdecoct.c" nm_copy_sd_shared "src/basic/hexdecoct.h" nm_copy_sd_shared "src/basic/hostname-util.c" nm_copy_sd_shared "src/basic/hostname-util.h" nm_copy_sd_shared "src/basic/in-addr-util.c" nm_copy_sd_shared "src/basic/in-addr-util.h" nm_copy_sd_shared "src/basic/io-util.c" nm_copy_sd_shared "src/basic/io-util.h" nm_copy_sd_shared "src/basic/list.h" nm_copy_sd_shared "src/basic/log.h" nm_copy_sd_shared "src/basic/macro.h" nm_copy_sd_shared "src/basic/memory-util.c" nm_copy_sd_shared "src/basic/memory-util.h" nm_copy_sd_shared "src/basic/mempool.c" nm_copy_sd_shared "src/basic/mempool.h" nm_copy_sd_shared "src/basic/missing_fcntl.h" nm_copy_sd_shared "src/basic/missing_random.h" nm_copy_sd_shared "src/basic/missing_socket.h" nm_copy_sd_shared "src/basic/missing_stat.h" nm_copy_sd_shared "src/basic/missing_syscall.h" nm_copy_sd_shared "src/basic/missing_type.h" nm_copy_sd_shared "src/basic/parse-util.c" nm_copy_sd_shared "src/basic/parse-util.h" nm_copy_sd_shared "src/basic/path-util.c" nm_copy_sd_shared "src/basic/path-util.h" nm_copy_sd_shared "src/basic/prioq.c" nm_copy_sd_shared "src/basic/prioq.h" nm_copy_sd_shared "src/basic/process-util.c" nm_copy_sd_shared "src/basic/process-util.h" nm_copy_sd_shared "src/basic/random-util.c" nm_copy_sd_shared "src/basic/random-util.h" nm_copy_sd_shared "src/basic/set.h" nm_copy_sd_shared "src/basic/signal-util.c" nm_copy_sd_shared "src/basic/signal-util.h" nm_copy_sd_shared "src/basic/siphash24.h" nm_copy_sd_shared "src/basic/socket-util.c" nm_copy_sd_shared "src/basic/socket-util.h" nm_copy_sd_shared "src/basic/sort-util.h" nm_copy_sd_shared "src/basic/sparse-endian.h" nm_copy_sd_shared "src/basic/stat-util.c" nm_copy_sd_shared "src/basic/stat-util.h" nm_copy_sd_shared "src/basic/stdio-util.h" nm_copy_sd_shared "src/basic/string-table.c" nm_copy_sd_shared "src/basic/string-table.h" nm_copy_sd_shared "src/basic/string-util.c" nm_copy_sd_shared "src/basic/string-util.h" nm_copy_sd_shared "src/basic/strv.c" nm_copy_sd_shared "src/basic/strv.h" nm_copy_sd_shared "src/basic/strxcpyx.c" nm_copy_sd_shared "src/basic/strxcpyx.h" nm_copy_sd_shared "src/basic/time-util.c" nm_copy_sd_shared "src/basic/time-util.h" nm_copy_sd_shared "src/basic/tmpfile-util.c" nm_copy_sd_shared "src/basic/tmpfile-util.h" nm_copy_sd_shared "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/user-util.h" nm_copy_sd_shared "src/basic/utf8.c" nm_copy_sd_shared "src/basic/utf8.h" nm_copy_sd_shared "src/basic/util.c" nm_copy_sd_shared "src/basic/util.h" nm_copy_sd_shared "src/shared/dns-domain.c" nm_copy_sd_shared "src/shared/dns-domain.h" nm_copy_sd_stdaux "src/basic/unaligned.h"
* | | all: use nm_clear_g_free() instead of g_clear_pointer()Thomas Haller2020-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | I think it's preferable to use nm_clear_g_free() instead of g_clear_pointer(, g_free). The reasons are not very strong, but I think it is overall preferable to have a shorthand for this frequently used functionality. sed 's/\<g_clear_pointer *(\([^;]*\), *\(g_free\) *)/nm_clear_g_free (\1)/g' $(git grep -l g_clear_pointer) -i
* | | shared: allow nm_dbus_connection_call_finish_variant_cb() with D-Bus methods ↵Thomas Haller2020-03-231-4/+2
| | | | | | | | | | | | that have no return value
* | | n-dhcp4: fallback to CLOCK_MONOTONIC for timerfd (resync with upstream)Thomas Haller2020-03-182-29/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream merge request [1] was solved differently from commit f49ce4121407 ('client: fallback to CLOCK_MONOTONIC for timerfd'). Resync with upstream. [1] https://github.com/nettools/n-dhcp4/pull/13 [2] https://github.com/nettools/n-dhcp4/commit/a0bb7c69a11a0db31fce5572c43ad7888694bf9e
* | | shared: add nm_g_variant_is_of_type() helperThomas Haller2020-03-171-0/+8
| | |
* | | shared: expose size of nm_ethtool_data array in headerThomas Haller2020-03-061-1/+1
| | |
* | | shared: move assertion in _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE()Thomas Haller2020-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | Move the assertion for valid LIST first. It only checks static data, and regardless of the entry_cmd, it should be done first. Fixes: f4d12f7b59b6 ('shared: add NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE() macro for lookup of structs')
* | | shared: fix handling %NULL argument in nm_ref_string_equals_str()Thomas Haller2020-03-021-1/+1
| | | | | | | | | | | | Fixes: 190a8ed425c1 ('shared: add nm_ref_string_equals_str() helper')
* | | shared: add NMU_IFACE_OVS_OR_KERNEL for nm_utils_ifname_valid()Thomas Haller2020-02-262-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the type, OVS interfaces also have a corresponding netdev in kernel (e.g. type "internal" does, type "patch" does not). Such a case is neither NMU_IFACE_OVS nor NMU_IFACE_KERNEL (alone). There should be a special type to represent those cases. Add NMU_IFACE_OVS_OR_KERNEL for that.
* | | shared: add NMU_IFACE_ANY for nm_utils_ifname_valid()Thomas Haller2020-02-262-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_utils_ifname_valid() is to validate "connection.interface-name" property. But the exact validation depends on the connection type. Add "NMU_IFACE_ANY" to validate the name to check whether it would be valid for any connection type. This is for completeness and for places where the caller might not know the connection type.
* | | shared: reject reserved names from "connection.interface-name"Thomas Haller2020-02-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | "all" and "default" never works. "bonding_masters" works if you unload the bonding module. Well, that should not really be called working... Reject these names.
* | | shared: reject '%' from nm_utils_ifname_valid() for kernel namesThomas Haller2020-02-261-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally, it's dangerous to reject values that were accepted previously. This will lead to NetworkManager being unable to load a profile from disk, which was loadable previously. On the other hand, kernel would not have treated this setting as it was intended. So, I would argue that the such a setting was not working (as intended) anyway. We can only hope that users don't configure arbitrary interface names. It generally isn't a good idea to do, so "breaking" such things is less of a concern.
* | | n-dhcp4: keep trying after a failure in send()Beniamino Galvani2020-02-241-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if an error is encountered during a send() of a message, the client fails and there is no possibility of recover, since no timers are armed after a failed event dispatch. An easy way to reproduce a failure is to add a firewall rule like: iptables -A OUTPUT -p udp --dport 67 -j REJECT which makes the send() fail with EPERM during the renew. In such case, the client should continue (failing) until it reaches the rebind phase at T2, when it will be able to renew the lease using the packet socket. In general, a failure to send a packet should not cause the failure of the client. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/419 https://bugzilla.redhat.com/show_bug.cgi?id=1806516
* | | n-dhcp4: fix logging macroBeniamino Galvani2020-02-241-2/+3
| | | | | | | | | | | | | | | The level can be a complex expression, don't use it directly in the macro.
* | | shared: fix suffix for NM_GOBJECT_PROPERTIES_DEFINE_BASE*() for multiple ↵Thomas Haller2020-02-241-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definitions To really use multiple NM_GOBJECT_PROPERTIES_DEFINE_BASE*() defines in the same source file, several fixes to the suffix handling are necessary. This fixes commit f13c7e3bbd87 ('shared: extend NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to defined names') to really work. Fixes: f13c7e3bbd87 ('shared: extend NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to defined names')
* | | shared: add more debug messages to nm_utils_parse_inaddr_bin_full()Beniamino Galvani2020-02-211-5/+31
| | | | | | | | | | | | | | | | | | Log the reason for the assertion failure to debug the crash in [1]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1797915
* | | shared: extend NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to ↵Thomas Haller2020-02-211-16/+22
| | | | | | | | | | | | | | | | | | | | | defined names This way, we will be able to use the macro multiple times in the same source file by using different suffixes.
* | | shared: add nm_utils_named_values_from_str_dict_full() to allow different ↵Thomas Haller2020-02-192-3/+18
| | | | | | | | | | | | sort order (or none)
* | | shared: add NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE() macro for lookup of ↵Thomas Haller2020-02-191-18/+41
| | | | | | | | | | | | structs
* | | shared: add NM_MORE_ASSERT_ONCE() macroThomas Haller2020-02-191-0/+18
| | |
* | | shared/trivial: add code comment to nm_utils_ifname_valid_kernel()Thomas Haller2020-02-181-0/+4
| | |
* | | shared: check for valid UTF-8 in nm_utils_ifname_valid()Thomas Haller2020-02-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The interface name might come from the command line or from a filename (like during nm_vpn_wireguard_import()). It's not clear that this is valid UTF-8. Asserting against that requires the caller to ensure that the encoding is valid. That is cumbersome, especially since we anyway check. Just report a regular error.
* | | nm-shared-utils: relax ovs ifname check to accept any (non-space) ASCII ↵Antonio Cardace2020-02-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | printable char quoting 'man ovs-vswitchd.conf.db': "The name must be alphanumeric and must not contain forward or backward slashes." OVS actually accepts a wider range of chars (all printable UTF-8 chars), NetworkManager restricts this to ASCII char as it's a safer option for now since OVS is not well documented on this matter. https://bugzilla.redhat.com/show_bug.cgi?id=1788432 Fixes: e7d72a14f6 ('libnm-core: use different ifname validation function for OVS bridges, ports and interfaces')
* | | n-dhcp4: request previous address after expirationBeniamino Galvani2020-02-172-4/+10
| | | | | | | | | | | | | | | If the lease expires and the client start again sending a discover, request the previous address.
* | | shared: fix returning out_len from nm_utils_hash_values_to_array()Thomas Haller2020-02-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The only affected caller is nm_modem_manager_get_modems(), which is used by NMDeviceBt for DUN connections. This is rather bad. Fixes: 4154d9618c90 ('bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data') Fixes: e688e70b372a ('shared: add nm_utils_hash_values_to_array() helper')
* | | nm-shared-utils: add nm_utils_ifname_valid*() to shared utilsAntonio Cardace2020-02-172-0/+102
| | | | | | | | | | | | | | | | | | Move the body of nm_utils_is_valid_iface_name() to nm_utils_ifname_valid_kernel() so that it's shared between NM and clients.
* | | shared: add LOGD_DHCP_from_addr_family() helperThomas Haller2020-02-171-0/+8
| |/ |/|
* | license: relicense "shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h" ↵Thomas Haller2020-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | under LGPL-2.1+ $ git shortlog -n -s a3e75f329446a93a61ca4c458a7657bd919f4fe6 -- shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h src/systemd/sd-adapt-core/nm-sd-adapt-core.c src/systemd/sd-adapt/nm-sd-adapt.'[hc]' src/systemd/nm-sd-adapt.'[hc]' src/dhcp-manager/systemd-dhcp/nm-sd-adapt.'[hc]' 46 Thomas Haller 7 Beniamino Galvani 3 Lubomir Rintel 2 Dan Williams 2 Dan Winship 1 Glenn Washburn 1 Jiří Klimeš Note that the contribution to the file by Glenn was removed in commit e27b15c00d23 ('all: remove CLOCK_BOOTTIME defintions'), so it is no longer relevant. All other contributors agreed to the relicensing according to "RELICENSE.md".
* | license: relicense "shared/nm-utils/nm-vpn-editor-plugin-call.h" under LGPL-2.1+Thomas Haller2020-02-161-1/+1
| | | | | | | | | | | | | | $ git shortlog -n -s a3e75f329446a93a61ca4c458a7657bd919f4fe6 -- shared/nm-utils/nm-vpn-editor-plugin-call.h shared/nm-vpn-editor-plugin-call.h 5 Thomas Haller All contributors agreed to the relicensing according to "RELICENSE.md".
* | license: relicense "shared/nm-libnm-core-intern-aux/nm-auth-subject.[hc]" ↵Thomas Haller2020-02-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | under LGPL-2.1+ $ git shortlog -n -s a3e75f329446a93a61ca4c458a7657bd919f4fe6 -- shared/nm-libnm-core-intern/nm-auth-subject.'[hc]' src/nm-auth-subject.'[hc]' 28 Thomas Haller 7 Dan Winship 1 Beniamino Galvani 1 Dan Williams 1 Jiří Klimeš All contributors agreed to the relicensing according to "RELICENSE.md".
* | license: relicense "shared/nm-glib-aux/nm-jansson.h" under LGPL-2.1+Thomas Haller2020-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | $ git shortlog -n -s a3e75f329446a93a61ca4c458a7657bd919f4fe6 -- shared/nm-glib-aux/nm-jansson.h shared/nm-utils/nm-jansson.h 7 Thomas Haller 1 Lubomir Rintel 1 Beniamino Galvani 1 Francesco Giudici All contributors agreed to the relicensing according to "RELICENSE.md".
* | license: relicense "shared/nm-glib-aux/nm-glib.h" under LGPL-2.1+Thomas Haller2020-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ git shortlog -n -s a3e75f329446a93a61ca4c458a7657bd919f4fe6 -- shared/nm-glib-aux/nm-glib.h shared/nm-utils/nm-glib.h shared/nm-glib.h include/nm-glib.h include/nm-glib-compat.h 35 Thomas Haller 12 Dan Winship 5 Dan Williams 3 Lubomir Rintel 2 Beniamino Galvani 1 Jan Kantert 1 Thomas Bechtold The last two contributions by Thomas and Jan are no longer present in any form, because they were for an older version of glib which is no longer supported. All other contributors agree to the licences change according to "RELICENSE.md" file.
* | all: drop explicit casts from _GET_PRIVATE() macro callsThomas Haller2020-02-141-2/+2
| | | | | | | | | | | | | | | | | | The _GET_PRIVATE() macros are all implemented based on _NM_GET_PRIVATE(). That macro tries to be more type safe and uses _Generic() to do the right thing. Explicitly casting is not only unnecessary, it defeats these (static) type checks. Don't do that.
* | shared: don't require callback argument to nm_dbus_connection_call_set()Thomas Haller2020-02-141-2/+0
| | | | | | | | It's fine to call propery-set without caring about the result.
* | shared: drop compat implementation for G_DEFINE_QUARK()th/define-fcn-macros-cleanupThomas Haller2020-02-131-16/+0
| | | | | | | | | | | | | | | | For one, we by now require glib >= 2.34.0, so this is not used. Also, I think G_DEFINE_QUARK() is rather ugly because it constructs the defined function name (so you cannot grep for it). We should use NM_CACHED_QUARK_FCN() instead.
* | shared: drop _STATIC variant of macros that define functionsThomas Haller2020-02-134-31/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several macros are used to define function. They had a "_STATIC" variant, to define the function as static. I think those macros should not try to abstract entirely what they do. They should not accept the function scope as argument (or have two variants per scope). This also because it might make sense to add additional __attribute__(()) to the function. That only works, if the macro does not pretend to *not* define a plain function. Instead, embrace what the function does and let the users place the function scope as they see fit. This also follows what is already done with static NM_CACHED_QUARK_FCN ("autoconnect-root", autoconnect_root_quark)
* | shared: explicitly implement binary search in ↵Thomas Haller2020-02-131-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NM_UTILS_STRING_TABLE_LOOKUP_DEFINE*() When looking at nm_utils_array_find_binary_search(), we see that binary search really isn't complicated. In nm_utils_array_find_binary_search() it looks complicated, because that is our general purpose function which accepts arbitrary lists, uses an opaque compare function, accepts a user data argument, and returns the insertion position. This is unnecessary for the narrow purpose in NM_UTILS_STRING_TABLE_LOOKUP_DEFINE*(). When we inline the binary search, it can be simplified, and the remaining parts is simple enough to prefer this duplication of binary search over using our general purpose function. Also, this gives the compiler more chance for optimization. For example, we can use "unsigned" as index type instead of gssize, because we know (at compile time), that this type will always be large enough for our LIST. Also, we can directly call strcmp(). The result is that the macro's implementation is also fast in the best case (where the needle is found with only one strcmp()) and in the cases where there is a small number of items to search. It thus alleviates concerns that using the macro might be slower than an optimized implementation. The binary size of the defined function increases slightly (from 112 bytes to 192 bytes, on x86_64, GCC, -O2). But according to my tests it is slightly and measurably faster.
* | shared/tests: add test for NM_UTILS_STRING_TABLE_LOOKUP_DEFINE*()Thomas Haller2020-02-131-0/+30
| |
* | shared: add entry_cmd argument to NM_UTILS_STRING_TABLE_LOOKUP_DEFINE*() macroThomas Haller2020-02-131-16/+24
| | | | | | | | This extra argument allows to tweak whether to assert for the input argument name.