summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* xxxth/bridge-multicast-routerThomas Haller2020-06-153-25/+28
|
* release: bump version to 1.27.0 (development)1.27.0-devThomas Haller2020-06-152-3/+3
|
* release: bump version to 1.25.90 (1.26-rc1)1.26-rc1Thomas Haller2020-06-152-2/+2
|
* firewalld: allow access to SSH in "nm-shared" firewalld zoneThomas Haller2020-06-151-0/+1
| | | | | SSH seems one of the few really trusted processes. It is even allowed for the public zone. Allow it in "nm-shared" zone too.
* all: reformat python files with python blackSayed Shah2020-06-1544-2014/+3232
| | | | | | Part of !537. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/537
* NEWS: updateBeniamino Galvani2020-06-151-1/+2
|
* glib: always re-implement g_steal_pointer()Thomas Haller2020-06-151-3/+9
| | | | | | | g_steal_pointer() is marked as GLIB_AVAILABLE_STATIC_INLINE_IN_2_44, that means we get a deprecated warning. Avoid that. We anyway re-implement the macro so that we can use it before 2.44 and so that it always does the typeof() cast.
* build: ensure man directory exists for "man/nm-settings-docs-*.xml"Thomas Haller2020-06-151-2/+2
| | | | | | It would seem that the proper dependency is "man/.dirstamp". But that just doesn't work. Use "man/common.ent" instead. If you figure out how to convince autotools to make .dirstamp working, send a patch.
* lldp: merge branch 'th/lldp-mud-url'Thomas Haller2020-06-153-11/+103
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/539
| * lldp: omit empty "object-id" for LLDP management addressThomas Haller2020-06-152-3/+4
| | | | | | | | | | It seems common that the object-id might be empty. Omit the field in that case.
| * lldp: expose "mud-url" LLDP attribute for the MUD usage descriptionThomas Haller2020-06-153-4/+54
| | | | | | | | | | See-also: https://github.com/systemd/systemd/pull/15234 See-also: https://github.com/the-tcpdump-group/tcpdump/blob/c4f8796bf8bec740621a360eded236d8991ea00f/tests/lldp_mudurl.pcap
| * lldp: cleanup converting binary LLDP fields to stringThomas Haller2020-06-151-5/+46
|/ | | | | | | Introduce and use format_string() helper to convert the binary fields to string. This is like systemd's parse_string() function.
* Revert "manager: change autoconnect-slaves logic for already active slaves"Beniamino Galvani2020-06-151-32/+3
| | | | | | | | | | The commit breaks many nmstate CI tests. It also breaks the autoconnect-slaves functionality: if the master gets reactivated and the slave was active, the slave is not reconnected. A different solution is needed for the original issue. This reverts commit 024e983c8e38d1f325ac64b9d84b2332afcd6549.
* NEWS: updateThomas Haller2020-06-151-0/+8
|
* ndisc: merge branch 'th/revert-ipv6-slaac-lifetimes' for nm-1-26Thomas Haller2020-06-154-44/+31
|\ | | | | | | | | | | | | | | | | These two changes are from a draft. They may not yet be ready for now. Revert the change for now. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/396#note_462123 (cherry picked from commit 3192f65d3b27feb91faaf87c4675ae2481bce848)
| * NEWS: updateThomas Haller2020-06-151-4/+0
| | | | | | | | (cherry picked from commit 5409db9fbd22c4dad02cfb2417500e61822d3229)
| * Revert "IPv6 SLAAC: Clamp received PIO and RIO Lifetime Values"Thomas Haller2020-06-151-22/+5
| | | | | | | | | | | | | | This reverts commit 0cbd9193cd0d6d5c18641c20c7e3bd08642208ce. This reverts commit a5290915d5e04a8f2277756d93a9857694f16029. (cherry picked from commit ad5fdd9d62df3188f2b5e4af0804e073a207be2c)
| * Revert "IPv6 SLAAC: Honor small PIO Valid Lifetimes"Thomas Haller2020-06-152-18/+26
|/ | | | | | This reverts commit 2da092b5922b823b51ec5ff5ad6e8d6d41c82a69. (cherry picked from commit a88be01da2c06203defd1b63b7f74f117daea401)
* systemd: merge branch systemd into masterThomas Haller2020-06-1368-790/+2007
|\
| * systemd: update code from upstream (2020-06-13)Thomas Haller2020-06-1365-785/+1995
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=6d0f38017c7476883103080372505d4811112346 ( 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-dhcp6-option.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_shared "src/shared/web-util.c" nm_copy_sd_shared "src/shared/web-util.h" nm_copy_sd_stdaux "src/basic/unaligned.h"
* | merge: branch 'bg/match-path-rh1673321'Beniamino Galvani2020-06-1222-942/+1597
|\ \ | | | | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/536 https://bugzilla.redhat.com/show_bug.cgi?id=1673321
| * | device: honor the match.path propertyBeniamino Galvani2020-06-121-0/+8
| | |
| * | all: add "path" property to the match settingBeniamino Galvani2020-06-129-7/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new "path" property to the match setting, which can be used to restrict a connection to devices with a given hardware path. The new property is a list of patterns that are matched against the ID_PATH udev property of devices. ID_PATH represents the topological persistent path of a device and typically contains a subsystem string (pci, usb, platform, etc.) and a subsystem-specific identifier. Some examples of paths are: pci-0000:00:02.0 pci-0000:00:14.0-usb-0:5:1.0 platform-1c40000.ethernet systemd-networkd also has a "Path=" option to match a device by udev ID_PATH.
| * | all: add device.path propertyBeniamino Galvani2020-06-1210-880/+1272
| | | | | | | | | | | | | | | Add a device property to expose its path as reported in the ID_PATH udev property.
| * | platform: add nm_platform_link_get_path()Beniamino Galvani2020-06-122-0/+11
| | | | | | | | | | | | | | | Add a function to obtain the link path as exported by the ID_PATH udev property.
| * | platform: rework nm_platform_link_get_unmanaged()Beniamino Galvani2020-06-121-18/+27
| | | | | | | | | | | | | | | Split out the code to get udev properties. It will be reused in the next commit.
| * | platform: rework nm_platform_link_get_udi()Beniamino Galvani2020-06-124-38/+3
|/ / | | | | | | | | Implement the function directly in nm-platform.c without virtual functions.
* | docs: fix build with mesonBeniamino Galvani2020-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following build error with meson: /usr/bin/python3 /home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py man/nm-settings-docs-nmcli.xml --only-from-first clients/cli/generate-docs-nm-settings-nmcli.xml libnm/nm-propery-infos-nmcli.xml libnm/nm-settings-docs-gir.xml Traceback (most recent call last): File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <module> xml_roots = list([ET.parse(f).getroot() for f in gl_input_files]) File "/home/bgalvani/work/NetworkManager/tools/generate-docs-nm-settings-docs-merge.py", line 120, in <listcomp> xml_roots = list([ET.parse(f).getroot() for f in gl_input_files]) File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 1202, in parse tree.parse(source, parser) File "/usr/lib64/python3.8/xml/etree/ElementTree.py", line 584, in parse source = open(source, "rb") FileNotFoundError: [Errno 2] No such file or directory: '--only-from-first' Fixes: 3c11116c484d ('docs: in "generate-docs-nm-settings-docs-merge.py" only take properties from first setting')
* | docs: show aliases for settings in `man nm-settings-nmcli`Thomas Haller2020-06-123-2/+12
| |
* | docs: don't show properties in `man nm-settings-nmcli` as tableThomas Haller2020-06-121-23/+32
| |
* | docs: drop "property aliases" section from `man nmcli`Thomas Haller2020-06-122-414/+24
| | | | | | | | | | The aliases are now shown in `man nm-settings-nmcli`. Also the list there gets generated and isn't hardcoded.
* | docs: use describe_doc for "generate-docs-nm-settings-nmcli.c"Thomas Haller2020-06-121-0/+3
| | | | | | | | | | In practice, this is exactly the same, because also the describe_doc is generated. However, in the future they might diverge.
* | docs: add "Alias" column to `man nm-settings-nmcli`Thomas Haller2020-06-122-1/+4
| |
* | docs: in "generate-docs-nm-settings-docs-merge.py" only take properties from ↵Thomas Haller2020-06-123-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | first setting Especially for "nm-settings-docs-nmcli.xml", the first XML to merge is "clients/cli/generate-docs-nm-settings-nmcli.xml". That file is generated with the meta data from nmcli, and it contains all the properties that are supported. Properties from other XML files, that are passed as additional arguments should not be merged. In most cases, there is no difference. It only matters for "ipv6.dad-timeout" and "user.data". For example, "ipv6.dad-timeout" is supported by GObject (part of "libnm/nm-settings-docs-gir.xml"), but not by nmcli. Don't include it in the manual. This also drops the now empty settings "dummy", "user", and "generic".
* | po: update Ukrainian (uk) translationYuri Chornoivan2020-06-111-881/+945
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/538
* | libnm/tests: assert for valid test input for _test_verify_options_bridge()Thomas Haller2020-06-111-3/+5
| |
* | libnm: don't require birdge multicast_snooping with multicast_router ↵Thomas Haller2020-06-113-30/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | auto,enabled This does not match kernel behavior. You seem to be able to configure multicast_snooping=auto,enabled with multicast_snooping off just fine. Possibly this constrained was inspired by `ip link`, which says: mcast_router MULTICAST_ROUTER - set bridge's multicast router if IGMP snooping is enabled. But kernel doesn't enforce this: ip link delete br0 2>/dev/null; \ ip link add br0 type bridge mcast_router 1 mcast_snooping 0; \ grep ^ /sys/devices/virtual/net/br0/bridge/{multicast_router,multicast_snooping} gives: /sys/devices/virtual/net/br0/bridge/multicast_router:1 /sys/devices/virtual/net/br0/bridge/multicast_snooping:0 We probably should not implement additional constrains on top of what kernel does, if the conditions are that obscure. Fixes: e01d3b4c2b89 ('nm-setting-bridge: add 'multicast-router' bridge option')
* | lldp: merge branch 'th/lldp-raw'Thomas Haller2020-06-118-626/+662
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/529
| * | lldp: accept all chassis-id/port-id types and support network-addressth/lldp-rawThomas Haller2020-06-111-44/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do what systemd does with sd_lldp_neighbor_get_chassis_id_as_string() and sd_lldp_neighbor_get_port_id_as_string(). Maybe we should use the systemd functions directly, however that is not done because the way how we convert the values to string is part of our stable API. Let's not rely on systemd for that. Also, support SD_LLDP_CHASSIS_SUBTYPE_NETWORK_ADDRESS and SD_LLDP_PORT_SUBTYPE_NETWORK_ADDRESS types. Use the same formatting scheme as systemd ([1]) and lldpd ([2]). [1] https://github.com/systemd/systemd/blob/a07e962549bc900365627482834896ea98996ff4/src/libsystemd-network/lldp-neighbor.c#L422 [2] https://github.com/vincentbernat/lldpd/blob/d21599d2e6fa08dcf4a0b49e0b9bc35c52311286/src/lib/atoms/chassis.c#L125 Also, in case we don't support the type or the type contains unexpected data, fallback to still expose the LLDP neighbor, and convert the value to a hex string (like systemd does). This means, lldp_neighbor_new() in practice can no longer fail and the error handling for that can be dropped. There is one tiny problem: now as fallback we expose the chassis-id/port-id as hex string. That means, if we in the future recognize a new type, we will have to change API for those types. The alternative would be to either hide the neighbor completely from the D-Bus API (as previously done), or not expose the hex strings on D-Bus. Neither seems very attractive, so expose the value (and reserve the right to change API in the future).
| * | lldp: use full chassis-id/port-id as ID for LLDP neighborThomas Haller2020-06-111-78/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the ID of LLDP neighbors follow what systemd does (w.r.t. what it consideres equality of two neighbors). Note that previously we did almost the same thing. Except, we compared priv->chassis_id and priv->port_id, but these values are string representations of the original (binary value). Don't use the pretty strings as ID but the original binary value.
| * | lldp: parse destination-address on demandThomas Haller2020-06-111-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | An invalid destination address doesn't need to break the LLDL neighbor entirely. In fact, systemd will already filter out such addresses. So in practice, the neighbor always has a valid destination address. There is thus no need to parse it already during lldp_neighbor_new().
| * | lldp: use nm_utils_ether_addr_equal() instead of re-implementationThomas Haller2020-06-111-19/+7
| | |
| * | lldp: only have GHashTable instance for LLDP neighbors when runningThomas Haller2020-06-112-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the instance is not running (after creation or after stop), there is no need to keep the GHashTable around. Create it when needed (during start) and clear it during stop. This makes it slightly cheaper to keep a NMLldpListener instance around, if it's currently not running. NMDevice already keeps the NMLldpListener around, even after stopping it. It's not clear whether the instance will be started again, so also clear the GHashTable. Also, one effect is that if you initially were in a network with many LLDP neibors, after stop and start, the GHashTable now gets recreated and may not need to allocate a large internal array as before.
| * | lldp: delay change notification for LLDP neighbor eventsThomas Haller2020-06-111-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already rate limit change events by two seconds. When we notice that something changed, we call data_changed_schedule(). Previously, that would immediately issue the change notification, if ratelimiting currently was not in effect. That means, if we happen go receive two LLDP neighbor events in short succession, then the first one will trigger the change notification right away, while the second will be rate limited. Avoid that by always issue scheduling the change notification in the background. And if we currently are not rate limited, with an idle handler with low priority.
| * | lldp: change order of dictionary fields for LLDP neighbor variantThomas Haller2020-06-112-6/+6
| | | | | | | | | | | | | | | | | | This changes the order to what the code did previously, before switching from GVariantDict to GVariantBuilder. But it changes the actually serialized order in the variant.
| * | lldp: use GVariantBuilder instead of GVariantDictThomas Haller2020-06-111-47/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GVariantDict is basically a GHashTable, and during g_variant_dict_end() it uses a GVariantBuilder to create the variant. This is totally unnecessary in this case. It's probably unnecessary in most use cases, because commonly we construct variants in a determined series of steps and don't need to add/remove keys. Aside the overhead, GHashTable also does not give a stable sort order, which seems a pretty bad property in this case. Note that the code changes the order in which we call g_variant_builder_add() for the fields in code, to preserve the previous order that GVariantDict actually created (at least, with my version of glib).
| * | lldp: add LLDP attributes to GVariant builder without intermediate parsing (2)Thomas Haller2020-06-111-465/+192
| | |
| * | lldp: add LLDP attributes to GVariant builder without intermediate parsing (1)Thomas Haller2020-06-111-26/+13
| | | | | | | | | | | | | | | | | | | | | The intermediate parsing step serves very little purpose. The only use is to ensure that we always add the keys in a stable order, but we can easily ensure that otherwise.
| * | lldp: use nm_g_variant_builder_add_sv*() helpers in "nm-lldp-listener.c"Thomas Haller2020-06-111-36/+25
| | |
| * | lldp: no longer keep parsed attributes in LldpNeighborThomas Haller2020-06-111-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need to parse them to construct the GVariant. There is no need to keep them around otherwise. We still keep LldpAttrs array and don't construct the GVariant right away. The benefit is that this way while parsing we set the array fields, and afterwards, when we generate the string dictionary, the keys are sorted.