]> git.ipfire.org Git - thirdparty/lldpd.git/log
thirdparty/lldpd.git
3 weeks agoliblldpctl: Fix const correctness of the receive callback master
Bartel Sielski [Tue, 17 Mar 2026 12:23:09 +0000 (13:23 +0100)] 
liblldpctl: Fix const correctness of the receive callback

3 weeks agobuild: use a multi-stage build for Dockerfile
Vincent Bernat [Sat, 14 Mar 2026 21:44:43 +0000 (22:44 +0100)] 
build: use a multi-stage build for Dockerfile

This should help when compiling for other architectures through QEMU as
the autogen.sh part is platform-independent.

3 weeks agobuild: untabify Dockerfile
Vincent Bernat [Sat, 14 Mar 2026 21:43:46 +0000 (22:43 +0100)] 
build: untabify Dockerfile

3 weeks agorelease: 1.0.21 1.0.21
Vincent Bernat [Sat, 14 Mar 2026 21:17:53 +0000 (22:17 +0100)] 
release: 1.0.21

4 weeks agodoc: be clearer about how to install on macOS
Vincent Bernat [Wed, 11 Mar 2026 08:25:26 +0000 (09:25 +0100)] 
doc: be clearer about how to install on macOS

None of the above methods (notably the Docker one) would work.

4 weeks agobuild: add a few more Docker platforms
Vincent Bernat [Wed, 11 Mar 2026 07:06:23 +0000 (08:06 +0100)] 
build: add a few more Docker platforms

And make it more readable.

Fix #456.

4 weeks agobuild: fix hardcoded ghcr.io path
Vincent Bernat [Wed, 11 Mar 2026 06:59:33 +0000 (07:59 +0100)] 
build: fix hardcoded ghcr.io path

Related to #456

4 weeks agodaemon/priv: factor out check of authorized paths
Vincent Bernat [Tue, 10 Mar 2026 20:03:37 +0000 (21:03 +0100)] 
daemon/priv: factor out check of authorized paths

4 weeks agodoc: fix libtool invocation
Vincent Bernat [Tue, 10 Mar 2026 19:58:54 +0000 (20:58 +0100)] 
doc: fix libtool invocation

4 weeks agodaemon: do not fallback to ioctl for wireless
Vincent Bernat [Tue, 10 Mar 2026 16:12:25 +0000 (17:12 +0100)] 
daemon: do not fallback to ioctl for wireless

Even very old kernels support this wireless directory.

4 weeks agodaemon: use /sys/class/net/.../wireless to check wireless interface
Vincent Bernat [Tue, 10 Mar 2026 16:10:51 +0000 (17:10 +0100)] 
daemon: use /sys/class/net/.../wireless to check wireless interface

IFLA_INFO_KIND never is "wireless" as wireless interfaces do not
implement `rtnl_link_ops`.

Fix #738

4 weeks agodaemon: only keep one privileged op to remove both socket and lock
Vincent Bernat [Tue, 10 Mar 2026 07:34:22 +0000 (08:34 +0100)] 
daemon: only keep one privileged op to remove both socket and lock

4 weeks agodaemon: fix arbitrary file deletion in the privileged process
Vincent Bernat [Tue, 10 Mar 2026 07:29:47 +0000 (08:29 +0100)] 
daemon: fix arbitrary file deletion in the privileged process

The `asroot_ctl_cleanup()` handler reads an arbitrary path from the
unprivileged process and deletes it. Instead, introduce
`asroot_ctl_cleanup_lock()` to only clean the lock and
`asroot_ctl_cleanup()` cleans the socket.

Fix #772

4 weeks agoclient: fix compilation warning about unterminated strings
Vincent Bernat [Tue, 10 Mar 2026 07:37:08 +0000 (08:37 +0100)] 
client: fix compilation warning about unterminated strings

With GCC 15, we get:

```
../../../src/client/json_writer.c: In function ‘json_element_dump’:
../../../src/client/json_writer.c:160:43: warning: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (3 chars into 2 available) [-Wunterminated-string-initialization]
  160 |         static const char pairs[2][2] = { "{}", "[]" };
      |                                           ^~~~
../../../src/client/json_writer.c:160:49: warning: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (3 chars into 2 available) [-Wunterminated-string-initialization]
  160 |         static const char pairs[2][2] = { "{}", "[]" };
      |                                                 ^~~~
```

This is a false positive as they are not used as strings, but let's
accomodate the compiler by using enough space for the NUL terminator.

4 weeks agodoc: add NEWS entry for latest commit
Vincent Bernat [Mon, 9 Mar 2026 20:55:21 +0000 (21:55 +0100)] 
doc: add NEWS entry for latest commit

4 weeks agointerfaces: use ethtool link mode bits for accurate MAU type selection (#771)
Ciro Iriarte [Mon, 9 Mar 2026 20:52:54 +0000 (17:52 -0300)] 
interfaces: use ethtool link mode bits for accurate MAU type selection (#771)

* interfaces: use ethtool link mode bits for accurate MAU type selection

For speeds >= 10G, consult the ethtool supported link mode bitmask
to determine the correct MAU type instead of relying solely on
speed + port type. This fixes incorrect MAU type announcements
(e.g., 100G-SR4 transceivers being reported as 100G-LR4).

Fall back to the existing port-type approximation when no link mode
bit matches (e.g., legacy kernels without GLINKSETTINGS).

Add missing ethtool link mode bit definitions (bits 52-89) and speed
defines for 200G/400G to the local ethtool header.

Fixes: #477
* interfaces: move mau variable to function scope

Address review feedback: declare mau at the top of iflinux_macphy()
instead of inside each case block.

* interfaces: simplify mau assignment with combined if-assign pattern

4 weeks agodaemon: fix path traversal vulnerability in asroot_iface_description_os()
Vincent Bernat [Mon, 9 Mar 2026 19:46:31 +0000 (20:46 +0100)] 
daemon: fix path traversal vulnerability in asroot_iface_description_os()

`asroot_iface_description_os()` a sysfs path from an interface name
received from the unprivileged process. The validation only rejects `\0`
or `.` in first position. Add `/` to the list of rejected characters to
avoid path traversal.

Fix #773

4 weeks agodaemon: fix path traversal vulnerability in asroot_open()
Vincent Bernat [Mon, 9 Mar 2026 19:19:11 +0000 (20:19 +0100)] 
daemon: fix path traversal vulnerability in asroot_open()

asroot_open() in src/daemon/priv-linux.c validates file paths against a
list of regex patterns using regexec(). The patterns are not anchored
with ^ or $, so regexec() performs substring matching. A path containing
an authorized pattern as a substring — with additional ../ traversal
components — passes validation but resolves to a different file when
passed to open().

For example, the pattern `/proc/net/bonding/[^.][^/]*` matches both:

- `/proc/net/bonding/bond0` (intended)
- `/proc/net/bonding/bond0/../../self/environ` (traversal — if bond0 is a directory)

Use anchors in the regex. Also, refuse any path containing `/..`, as it
is not possible to express with POSIX basic regular expression.

Fix #774.

5 weeks agobuild: bump actions/upload-artifact from 6 to 7 769/head
dependabot[bot] [Sun, 1 Mar 2026 19:11:07 +0000 (19:11 +0000)] 
build: bump actions/upload-artifact from 6 to 7

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
5 weeks agobuild: bump actions/download-artifact from 7 to 8
dependabot[bot] [Sun, 1 Mar 2026 19:11:01 +0000 (19:11 +0000)] 
build: bump actions/download-artifact from 7 to 8

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 weeks agodocs: add NEWS entry for latest PR
Vincent Bernat [Thu, 19 Feb 2026 15:01:02 +0000 (16:01 +0100)] 
docs: add NEWS entry for latest PR

7 weeks agoMerge pull request #763 from thbtcllt/dev
Vincent Bernat [Thu, 19 Feb 2026 14:59:32 +0000 (15:59 +0100)] 
Merge pull request #763 from thbtcllt/dev

Add lldp configuration option to send mac address for port id and interface alias for port description

7 weeks agotest: add test for the new portdescription-source option 763/head
tcollet [Wed, 18 Feb 2026 15:55:18 +0000 (16:55 +0100)] 
test: add test for the new portdescription-source option

test result:
- 148 passed
- 7 skipped
- 0 failed

7 weeks agodoc: add description of new portdescription-source option
tcollet [Wed, 18 Feb 2026 15:08:43 +0000 (16:08 +0100)] 
doc: add description of new portdescription-source option

7 weeks agointerface: add alias on neighbors display
tcollet [Wed, 21 Jan 2026 09:29:07 +0000 (10:29 +0100)] 
interface: add alias on neighbors display

With previous commit it is possible to configure (PortID / Port Descr) to
provide the macaddress and the interface alias.
To help to retrieve the information the command 'lldpcli show neighbors'
provides the alias of the interface if present.

7 weeks agoconfig: add portdescription-source option
tcollet [Wed, 21 Jan 2026 08:45:24 +0000 (09:45 +0100)] 
config: add portdescription-source option

This new option allows to control the port description source
(alias vs ifname) when the portidsubtype is macaddress.

Usage:
  lldpcli configure lldp portidsubtype macaddress
  lldpcli configure lldp portdescription-source alias

Result: PortID = MAC address, PortDescr = interface alias

8 weeks agofix: Swallow exceptions caused by user callbacks
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Mon, 9 Feb 2026 15:25:29 +0000 (16:25 +0100)] 
fix: Swallow exceptions caused by user callbacks

Otherwise, the process will crash.

2 months agoupdate: Remove ctx pointers from C++ wrapper change callbacks
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Mon, 2 Feb 2026 20:05:48 +0000 (21:05 +0100)] 
update: Remove ctx pointers from C++ wrapper change callbacks

Instead, use lambdas if private contexts are required. They are way more C++-idiomatic.

2 months agoosx: sync HomeBrew formula
Vincent Bernat [Sun, 1 Feb 2026 11:07:46 +0000 (12:07 +0100)] 
osx: sync HomeBrew formula

2 months agoosx: update HomeBrew formula
Vincent Bernat [Sun, 1 Feb 2026 11:04:29 +0000 (12:04 +0100)] 
osx: update HomeBrew formula

2 months agofix: Avoid potential deadlock
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Mon, 12 Jan 2026 09:04:17 +0000 (10:04 +0100)] 
fix: Avoid potential deadlock

Don't keep a mutex lock while running the user callbacks to avoid potential deadlocks caused by callbacks that the user code requires.

3 months agobuild: bump actions/upload-artifact from 5 to 6
dependabot[bot] [Thu, 1 Jan 2026 19:01:17 +0000 (19:01 +0000)] 
build: bump actions/upload-artifact from 5 to 6

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months agobuild: bump cross-platform-actions/action from 0.30.0 to 0.32.0
dependabot[bot] [Thu, 1 Jan 2026 19:01:21 +0000 (19:01 +0000)] 
build: bump cross-platform-actions/action from 0.30.0 to 0.32.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.30.0 to 0.32.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.30.0...v0.32.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months agobuild: bump actions/download-artifact from 6 to 7
dependabot[bot] [Thu, 1 Jan 2026 19:01:24 +0000 (19:01 +0000)] 
build: bump actions/download-artifact from 6 to 7

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agodaemon/protocols: fix typo in CDP_SWITCH_DEFAULT_POE_PD.
Vincent Bernat [Sat, 6 Dec 2025 07:57:28 +0000 (08:57 +0100)] 
daemon/protocols: fix typo in CDP_SWITCH_DEFAULT_POE_PD.

4 months agobuild: update automake/autoconf for OpenBSD
Vincent Bernat [Tue, 2 Dec 2025 11:00:23 +0000 (12:00 +0100)] 
build: update automake/autoconf for OpenBSD

4 months agobuild: test more BSD versions
Vincent Bernat [Tue, 2 Dec 2025 07:49:21 +0000 (08:49 +0100)] 
build: test more BSD versions

4 months agobuild: bump actions/checkout from 5 to 6
dependabot[bot] [Mon, 1 Dec 2025 21:44:27 +0000 (21:44 +0000)] 
build: bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agobuild: bump cross-platform-actions/action from 0.29.0 to 0.30.0
dependabot[bot] [Mon, 1 Dec 2025 21:44:29 +0000 (21:44 +0000)] 
build: bump cross-platform-actions/action from 0.29.0 to 0.30.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 0.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agobuild: bump actions/upload-artifact from 4 to 5
dependabot[bot] [Sat, 1 Nov 2025 19:01:20 +0000 (19:01 +0000)] 
build: bump actions/upload-artifact from 4 to 5

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agobuild: bump actions/download-artifact from 5 to 6
dependabot[bot] [Sat, 1 Nov 2025 19:01:22 +0000 (19:01 +0000)] 
build: bump actions/download-artifact from 5 to 6

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months agodaemon/lldpd: handle empty case for PRETTY_NAME
Vincent Bernat [Sun, 26 Oct 2025 10:37:59 +0000 (11:37 +0100)] 
daemon/lldpd: handle empty case for PRETTY_NAME

Again, fix #751.

5 months agodaemon/lldpd: fix off-by-one issue when PRETTY_NAME is empty
Vincent Bernat [Sun, 26 Oct 2025 08:20:45 +0000 (09:20 +0100)] 
daemon/lldpd: fix off-by-one issue when PRETTY_NAME is empty

5 months agolldpd: fix leak in levent_snmp_read by cleaning up netsnmp_large_fd_set
Joshua Rogers [Sun, 26 Oct 2025 04:03:20 +0000 (12:03 +0800)] 
lldpd: fix leak in levent_snmp_read by cleaning up netsnmp_large_fd_set

5 months agodaemon/lldpd: handle case where PRETTY_NAME is empty
Vincent Bernat [Sun, 26 Oct 2025 07:53:26 +0000 (08:53 +0100)] 
daemon/lldpd: handle case where PRETTY_NAME is empty

Fix #751

5 months agoAdd missing compat.h header under src/client/
xndr [Wed, 15 Oct 2025 18:41:57 +0000 (11:41 -0700)] 
Add missing compat.h header under src/client/

Under certain conditions, build would fail due to a missing reference to
\#include "../compat/compat.h" in text_writer.c, kv_writer.c and
xml_writer.c.

example:
---------------
lldpd-1.0.20/src/client/text_writer.c:157:9: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        priv = malloc(sizeof(*priv));
               ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-text_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2
---------------
lldpd-1.0.20/src/client/kv_writer.c:41:19: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        if ((newprefix = malloc(s + 1)) == NULL) fatal(NULL, NULL);
                         ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-kv_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2
---------------
lldpd-1.0.20/src/client/xml_writer.c:139:9: fatal error: call to undeclared function 'rpl_malloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        priv = malloc(sizeof(*priv));
               ^
../../config.h:316:16: note: expanded from macro 'malloc'
\#define malloc rpl_malloc
               ^
1 error generated.
make[2]: *** [lldpcli-xml_writer.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [stamp-x86_64] Error 2

6 months agorelease: 1.0.20 1.0.20
Vincent Bernat [Sat, 13 Sep 2025 08:41:05 +0000 (10:41 +0200)] 
release: 1.0.20

7 months agobuild: bump actions/download-artifact from 4 to 5
dependabot[bot] [Tue, 2 Sep 2025 09:01:58 +0000 (09:01 +0000)] 
build: bump actions/download-artifact from 4 to 5

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months agobuild: bump actions/checkout from 4 to 5
dependabot[bot] [Tue, 2 Sep 2025 10:14:33 +0000 (10:14 +0000)] 
build: bump actions/checkout from 4 to 5

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
7 months agodaemon/interfaces: fix management address selection when negative
Vincent Bernat [Sat, 30 Aug 2025 07:56:30 +0000 (09:56 +0200)] 
daemon/interfaces: fix management address selection when negative

When we had a negative IP address, and nothing positive, the address was
still selected as it didn't match an interface. When all negative, we
should only select an address if both IP and interface are allowed.

This mechanism is becoming a bit complex.

7 months agodocs: add a NEWS entry for the previous change
Vincent Bernat [Tue, 19 Aug 2025 17:57:37 +0000 (19:57 +0200)] 
docs: add a NEWS entry for the previous change

7 months agoadd support for vlan-advertisements configuration (#740)
ugoldfeld [Tue, 19 Aug 2025 17:56:44 +0000 (20:56 +0300)] 
add support for vlan-advertisements configuration (#740)

* add support for vlan-advertisements configuration

adding new configurations configure [ports ethx [,..]] lldp vlan-advertisements pattern and
unconfigure [ports ethx,[,...]] lldp vlan-advertisements pattern.
The commands enable control of which vlans are advertised

* Code review changes

Updated manual page.
Added add an example of invocation in tests/lldpcli.conf.
Added tests to tests/integration/test_dot1.py.
Vlan formatting fixes.

* more CR fixes

* Fix memory leak

fixing port->p_vlan_advertise_pattern memory leak

8 months agoclient: keep "configure med fast-start" working
Vincent Bernat [Sat, 9 Aug 2025 18:24:29 +0000 (20:24 +0200)] 
client: keep "configure med fast-start" working

People should now use "configure lldp fast-start", but we keep the
previous configuration working as well.

Add an entry in NEWS.

Fix #680 (well, previous commit did)

8 months agofix: Some cleanup in moving fast-start into LLDP core
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Fri, 17 Jan 2025 07:54:24 +0000 (08:54 +0100)] 
fix: Some cleanup in moving fast-start into LLDP core

8 months agofix: Move tx-fast config from MED to LLDP section
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Thu, 24 Oct 2024 09:12:16 +0000 (11:12 +0200)] 
fix: Move tx-fast config from MED to LLDP section

8 months agofix: Always TX fast start complient to IEEE802.1as-2009
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Mon, 21 Oct 2024 12:32:45 +0000 (14:32 +0200)] 
fix: Always TX fast start complient to IEEE802.1as-2009

8 months agodaemon/interfaces: fix double-free when unable to initialize interface
Vincent Bernat [Sat, 9 Aug 2025 16:45:30 +0000 (18:45 +0200)] 
daemon/interfaces: fix double-free when unable to initialize interface

When an interface is converted from one type to another and cannot be
initialized, we free it twice: once on the error and again when removing
unused interfaces.

Remove the first occurrence and ensure we get in a state where the
interface can be both cleaned up or reinstantiated in a later round.

8 months agoautoconf: Use m4sh syntax where appropriate
Lars Wendler [Sun, 12 Jan 2025 16:17:25 +0000 (17:17 +0100)] 
autoconf: Use m4sh syntax where appropriate

This fixes an issue where when using the options

  --without-embedded-libevent --without-libbsd

configure errors out with missing libevent:

  checking for libevent >= 2.0.5... no
  configure: error: *** libevent not found

but succeeds to find libevent when using

  --without-embedded-libevent --with-libbsd

configure options instead.
See also: https://autotools.info/autoconf/m4sh.html

8 months agobuild: bump cross-platform-actions/action from 0.28.0 to 0.29.0
dependabot[bot] [Fri, 1 Aug 2025 19:21:45 +0000 (19:21 +0000)] 
build: bump cross-platform-actions/action from 0.28.0 to 0.29.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months agoMerge pull request #742 from rbu9fe/fix/error-category
Vincent Bernat [Sat, 9 Aug 2025 16:49:58 +0000 (18:49 +0200)] 
Merge pull request #742 from rbu9fe/fix/error-category

fix: Error category handling

8 months agofix: Add missing include 742/head
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Wed, 6 Aug 2025 09:24:55 +0000 (11:24 +0200)] 
fix: Add missing include

8 months agofix: Add missing is_error_code_enum specialization
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Tue, 5 Aug 2025 17:34:39 +0000 (19:34 +0200)] 
fix: Add missing is_error_code_enum specialization

Directly pass error code to std::system_error.

8 months agofix: Error category handling
Breuninger Matthias (ETAS-ICA/XPC-Fe3) [Tue, 5 Aug 2025 14:38:16 +0000 (16:38 +0200)] 
fix: Error category handling

A std::error_code stores the error category only by reference, hence, we must use an object in static storage.
Add lldpcli::make_error_code for convenience similar to std::make_error_code.

10 months agobuild: bump cross-platform-actions/action from 0.27.0 to 0.28.0
dependabot[bot] [Sun, 1 Jun 2025 19:39:46 +0000 (19:39 +0000)] 
build: bump cross-platform-actions/action from 0.27.0 to 0.28.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.27.0 to 0.28.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.27.0...v0.28.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 0.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
10 months agolib/cpp: Fix memory leaks in LldpCtl
PM Holtmo [Fri, 23 May 2025 14:10:25 +0000 (16:10 +0200)] 
lib/cpp: Fix memory leaks in LldpCtl

LldpCtl::GetInterfaces() and LldpAtom::GetAtomList() did not decrement ref for retrieved atoms
Ensure parent atom outlives its children atoms

10 months agolib/cpp: LldpCtl supports non default transports
PM Holtmo [Tue, 29 Apr 2025 10:44:34 +0000 (12:44 +0200)] 
lib/cpp: LldpCtl supports non default transports

added optional arg to lldpd unix socket for constructor

12 months agodoc: add entry in NEWS for previous commit
Vincent Bernat [Thu, 10 Apr 2025 08:22:28 +0000 (10:22 +0200)] 
doc: add entry in NEWS for previous commit

12 months agodaemon/priv: fix PACKET_IGNORE_OUTGOING
Jon Kohler [Thu, 10 Apr 2025 06:59:39 +0000 (23:59 -0700)] 
daemon/priv: fix PACKET_IGNORE_OUTGOING

Switch from netpacket/packet.h to linux/if_packet.h to pick up both
sockaddr_ll and PACKET_IGNORE_OUTGOING.

Fixes case where PACKET_IGNORE_OUTGOING was compiled out due to ifdef
conditional, which caused Linux zerocopy to break.

Fixes #732

Signed-off-by: Jon Kohler <jon@nutanix.com>
12 months agobuild: bump cachix/install-nix-action from 30 to 31
dependabot[bot] [Tue, 1 Apr 2025 19:55:45 +0000 (19:55 +0000)] 
build: bump cachix/install-nix-action from 30 to 31

Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: '31'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
12 months agobuild: Fix macos compile warning on macos >= 12
Paul Donald [Wed, 26 Mar 2025 01:12:43 +0000 (02:12 +0100)] 
build: Fix macos compile warning on macos >= 12

dmi-osx.c:37:40: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
        service = IOServiceGetMatchingService(kIOMasterPortDefault, matching);
                                              ^~~~~~~~~~~~~~~~~~~~
                                              kIOMainPortDefault

12 months agoman: clarify what the power class numbers mean for 802.3at, in dot3
Paul Donald [Wed, 26 Mar 2025 00:27:45 +0000 (01:27 +0100)] 
man: clarify what the power class numbers mean for 802.3at, in dot3

12 months agoman: Amend keyword colour formatted as operations and not values.
Paul Donald [Tue, 25 Mar 2025 22:21:44 +0000 (23:21 +0100)] 
man: Amend keyword colour formatted as operations and not values.

12 months agocomment cleanup and spelling fixes
Paul Donald [Wed, 26 Mar 2025 18:17:16 +0000 (19:17 +0100)] 
comment cleanup and spelling fixes

12 months agodifferentiate between setup(n) and set(v) up
Paul Donald [Wed, 26 Mar 2025 18:01:35 +0000 (19:01 +0100)] 
differentiate between setup(n) and set(v) up

13 months agodaemon: fix typo in comment
Vincent Bernat [Sat, 22 Feb 2025 08:43:30 +0000 (09:43 +0100)] 
daemon: fix typo in comment

14 months agoAdd UnregisterInterfaceCallback
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Fri, 31 Jan 2025 12:09:27 +0000 (13:09 +0100)] 
Add UnregisterInterfaceCallback

14 months agoSetValue: Add various string-like type support
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Fri, 31 Jan 2025 12:06:32 +0000 (13:06 +0100)] 
SetValue: Add various string-like type support

14 months agoadd more missing syscalls to seccomp profile
Christian Bricart [Thu, 30 Jan 2025 10:15:26 +0000 (11:15 +0100)] 
add more missing syscalls to seccomp profile

it turned out, adding just clock_gettime64()
from #710 has not been enough for ia32 platform.

iteratively added additional syscalls, that
prevented lldpd from starting up without
bailing out with SIGSYS

14 months agobuild: bump cross-platform-actions/action from 0.26.0 to 0.27.0
dependabot[bot] [Sat, 1 Feb 2025 19:25:30 +0000 (19:25 +0000)] 
build: bump cross-platform-actions/action from 0.26.0 to 0.27.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.26.0 to 0.27.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
14 months agodaemon: add clock_gettime64 to seccomp profile
Vincent Bernat [Thu, 30 Jan 2025 06:28:49 +0000 (07:28 +0100)] 
daemon: add clock_gettime64 to seccomp profile

Fix #710

14 months agodebian: also install C++ header in Debian package
Vincent Bernat [Fri, 17 Jan 2025 21:24:50 +0000 (22:24 +0100)] 
debian: also install C++ header in Debian package

14 months agofix: Add lldpctl.hpp to the include list
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Fri, 17 Jan 2025 16:42:02 +0000 (17:42 +0100)] 
fix: Add lldpctl.hpp to the include list

14 months agobuild: bump cross-platform-actions/action from 0.25.0 to 0.26.0
dependabot[bot] [Wed, 1 Jan 2025 19:25:45 +0000 (19:25 +0000)] 
build: bump cross-platform-actions/action from 0.25.0 to 0.26.0

Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.25.0 to 0.26.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
14 months agolib: fix warning about uninitialized variable 1.0.19
Vincent Bernat [Sat, 11 Jan 2025 11:44:40 +0000 (12:44 +0100)] 
lib: fix warning about uninitialized variable

This is not really the case, but older compilers may not be able to
detect there is no branch when this variable is uninitialized.

14 months agobuild: remove hacks around NetSNMP
Vincent Bernat [Sat, 11 Jan 2025 11:32:17 +0000 (12:32 +0100)] 
build: remove hacks around NetSNMP

The workaround for -D_FORTIFY_SOURCE was failing on Fedora because it
was not robust enough. The current version was tested with:

- Fedora 41
- Debian 10
- Ubuntu Trusty (14.04)
- CentOS 7

14 months agorelease: 1.0.19
Vincent Bernat [Sat, 11 Jan 2025 11:08:07 +0000 (12:08 +0100)] 
release: 1.0.19

14 months agodoc: finalize changelog
Vincent Bernat [Sat, 11 Jan 2025 11:06:22 +0000 (12:06 +0100)] 
doc: finalize changelog

15 months agolib: format *.hpp as well
Vincent Bernat [Sat, 14 Dec 2024 20:26:47 +0000 (21:26 +0100)] 
lib: format *.hpp as well

15 months agofeat: Add lldpctl C++ wrapper (#693)
rbu9fe [Sat, 14 Dec 2024 20:24:51 +0000 (21:24 +0100)] 
feat: Add lldpctl C++ wrapper (#693)

* feat: Add lldpctl C++ wrapper

* fix: Call the new lldpctl_watch_sync_unblock() on watch termination

* fix: Category name

16 months agoclient: fix global tx hold and interval setting
Hangbin Liu [Mon, 2 Dec 2024 06:34:44 +0000 (14:34 +0800)] 
client: fix global tx hold and interval setting

In the following fixed commit, I forgot to fix the transmission (tx) hold
and interval range in the global configuration setting.

Fixes: 7b9abb819337 ("client: add range restriction for tx hold and interval")
Reported-by: Fei Liu <feliu@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
16 months agolldpd: fix ttl range on ports
Hangbin Liu [Mon, 2 Dec 2024 06:33:16 +0000 (14:33 +0800)] 
lldpd: fix ttl range on ports

In the following fixed commit, I forgot to fix the ttl range for
interfaces/ports.

Fixes: a73e04f46ebe ("lldpd: limit tx ttl to 65535")
Reported-by: Fei Liu <feliu@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
16 months agodaemon: use code from sd_notify(3) for handling notify socket
Vincent Bernat [Sat, 7 Dec 2024 11:24:26 +0000 (12:24 +0100)] 
daemon: use code from sd_notify(3) for handling notify socket

This also fixes a compilation error about connect().

16 months agolib: fix formatting
Vincent Bernat [Sat, 7 Dec 2024 10:48:12 +0000 (11:48 +0100)] 
lib: fix formatting

16 months agolib: bump library version
Vincent Bernat [Sat, 7 Dec 2024 10:39:38 +0000 (11:39 +0100)] 
lib: bump library version

Also fix versioning of lldpctl_watch_sync_unblock. And add a NEWS entry.

16 months agodocs: add an entry for change about AppArmor
Vincent Bernat [Mon, 28 Oct 2024 07:51:00 +0000 (08:51 +0100)] 
docs: add an entry for change about AppArmor

16 months agofeat: Add lldpctl_watch_sync_unblock (#696)
rbu9fe [Sat, 7 Dec 2024 10:36:09 +0000 (11:36 +0100)] 
feat: Add lldpctl_watch_sync_unblock (#696)

* feat: Add lldpctl_watch_sync_unblock

* update: Replace select by epoll

* refactor: Replace epoll by poll to support non-Linux OS

* update: Let lldpcli terminate gracefully

17 months agofix: Typo
Breuninger Matthias (ETAS-DAP/XPC-Fe3) [Mon, 4 Nov 2024 08:10:15 +0000 (09:10 +0100)] 
fix: Typo

17 months agobuild: bump cachix/install-nix-action from 29 to 30
dependabot[bot] [Fri, 1 Nov 2024 19:24:31 +0000 (19:24 +0000)] 
build: bump cachix/install-nix-action from 29 to 30

Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 29 to 30.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v29...v30)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
17 months agofix: add socket lock to AppArmor policy
Sten Spans [Mon, 28 Oct 2024 07:42:29 +0000 (08:42 +0100)] 
fix: add socket lock to AppArmor policy

17 months agobuild: query pkg-config for readline/libedit/libeditline
Vincent Bernat [Sat, 26 Oct 2024 06:55:08 +0000 (08:55 +0200)] 
build: query pkg-config for readline/libedit/libeditline

Fix #686