Version in base suite: 1.0.11-1 Base version: lldpd_1.0.11-1 Target version: lldpd_1.0.12-1+deb11u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/l/lldpd/lldpd_1.0.11-1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/l/lldpd/lldpd_1.0.12-1+deb11u1.dsc .dist-version | 2 ChangeLog | 26 + Makefile.in | 13 NEWS | 7 README.md | 200 +++++++--- aclocal.m4 | 64 +-- ar-lib | 2 compile | 2 configure | 37 + configure.ac | 9 debian/changelog | 14 debian/patches/0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch | 27 + debian/patches/0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch | 93 ++++ debian/patches/series | 2 depcomp | 2 libevent/Makefile.in | 15 libevent/aclocal.m4 | 60 +-- libevent/build-aux/compile | 2 libevent/build-aux/depcomp | 2 libevent/build-aux/missing | 2 libevent/build-aux/test-driver | 11 libevent/configure | 17 m4/libevent.m4 | 7 m4/progname.m4 | 9 missing | 2 osx/Makefile.in | 8 src/Makefile.in | 10 src/client/Makefile.in | 10 src/client/commands.c | 25 - src/client/conf-power.c | 13 src/client/display.c | 11 src/client/lldpcli.8.in | 2 src/compat/Makefile.in | 10 src/daemon/Makefile.in | 10 src/daemon/lldpd.c | 23 + src/lib/Makefile.in | 10 src/lib/atoms/dot3.c | 2 test-driver | 11 tests/Makefile.in | 10 39 files changed, 561 insertions(+), 221 deletions(-) diff -Nru lldpd-1.0.11/.dist-version lldpd-1.0.12/.dist-version --- lldpd-1.0.11/.dist-version 2021-05-01 16:56:02.000000000 +0000 +++ lldpd-1.0.12/.dist-version 2021-08-20 20:27:55.000000000 +0000 @@ -1 +1 @@ -1.0.11 +1.0.12 diff -Nru lldpd-1.0.11/ChangeLog lldpd-1.0.12/ChangeLog --- lldpd-1.0.11/ChangeLog 2021-05-01 16:56:01.000000000 +0000 +++ lldpd-1.0.12/ChangeLog 2021-08-20 20:27:54.000000000 +0000 @@ -1,3 +1,29 @@ +1.0.12 [2021-08-20 22:25:09 +0200]: + + - [2129b015777e] release: 1.0.12 (Vincent Bernat) + - [b341c404a8e4] ci: fetch tags when doing a release (Vincent Bernat) + - [f2f8ff5eea5a] doc: fix typo (Vincent Bernat) + - [ca8206115c5f] github: emphasize more that the issue tracker is not a support forum (Vincent Bernat) + - [abfb5c136213] github: fix release workflow (Vincent Bernat) + - [f6b6b17b16f6] github: better caching for coverity toolchain (Vincent Bernat) + - [5e62e262c853] github: automatically publish a release (Vincent Bernat) + - [f0867af0092f] ci: reduce the number of docker images to maintain (Vincent Bernat) + - [206db033686a] build: modernize a bit autoconf setup (to 2.69) (Vincent Bernat) + - [97c127127ab8] doc: explain which tags to use for Docker (Vincent Bernat) + - [2f9ae77dded4] ci: fix ppc64el platform (Vincent Bernat) + - [bab229e18de9] ci: run coverity only once a week (Vincent Bernat) + - [a244ecfbba82] ci: build and publish a Dockerfile (Vincent Bernat) + - [1aed5ced2dc0] doc: change title format to use pound for markdown (Vincent Bernat) + - [c82da6985ab8] tests: remove old Dockerfile.wheezy (Vincent Bernat) + - [7300ba8a298e] github: templates for bug report and feature request (Vincent Bernat) + - [edbe893084b5] github: add funding using BMC (Vincent Bernat) + - [0e05b829bb90] lldpcli: require powerpairs for Dot3 power even when PD (Vincent Bernat) + - [8aed1c35acd6] Updates documentation for Android target Adds specific compilation steps Adds links to source and NDK Adds installation script example (Zach Cardoza) + - [a1c9d4bef7ff] client: put lock file in the same directory as the socket (Vincent Bernat) + - [104cdb42d0b7] tests: use a tmpfs for /var/lock and handle broken symlinks (Vincent Bernat) + - [75dc6ac5f5db] tests: create /var/lock if it does not exist (Vincent Bernat) + - [c38c53d012f3] client: use a dedicated file lock to prevent concurrent changes (Vincent Bernat) + 1.0.11 [2021-05-01 18:52:30 +0200]: - [1b297ccc0956] release: 1.0.11 (Vincent Bernat) diff -Nru lldpd-1.0.11/Makefile.in lldpd-1.0.12/Makefile.in --- lldpd-1.0.11/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -229,11 +229,8 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/doxygen.am ChangeLog NEWS ar-lib compile \ + $(srcdir)/doxygen.am ChangeLog NEWS README.md ar-lib compile \ config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) @@ -294,6 +291,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -329,6 +328,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -716,7 +716,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/NEWS lldpd-1.0.12/NEWS --- lldpd-1.0.11/NEWS 2021-04-27 20:57:48.000000000 +0000 +++ lldpd-1.0.12/NEWS 2021-08-20 20:24:35.000000000 +0000 @@ -1,3 +1,10 @@ +lldpd (1.0.12) + * Fix: + + Use a dedicated file lock to prevent concurrent changes from lldpcli. + + Require/display powerpairs for Dot3 power even when device type is PD. + * Changes: + + Provide a Docker image and make it available on GitHub. + lldpd (1.0.11) * Changes: + Disable LLDP in firmware for Intel X7xx cards. diff -Nru lldpd-1.0.11/README.md lldpd-1.0.12/README.md --- lldpd-1.0.11/README.md 2021-04-27 20:40:58.000000000 +0000 +++ lldpd-1.0.12/README.md 2021-06-22 07:42:55.000000000 +0000 @@ -1,12 +1,10 @@ -lldpd: implementation of IEEE 802.1ab (LLDP) -============================================ +# lldpd: implementation of IEEE 802.1ab (LLDP) ![Build Status](https://github.com/lldpd/lldpd/workflows/CI/badge.svg) https://lldpd.github.io/ -Features --------- +## Features LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed to supplant proprietary Link-Layer protocols such as @@ -35,8 +33,7 @@ [WinLLDPService](https://github.com/raspi/WinLLDPService/) as a transmit-only agent. -Installation ------------- +## Installation For general instructions [prefer the website](https://lldpd.github.io/installation.html), @@ -62,8 +59,29 @@ line. If you don't want to run it as root, just install it setuid or setgid `_lldpd`. -Installation (macOS) ------------------------ +## Installation (Docker) + +You can use Docker to run `lldpd`: + + docker run --rm --net=host --uts=host \ + -v /etc/os-release:/etc/os-release \ + --cap-add=NET_RAW --cap-add=NET_ADMIN \ + --name lldpd \ + ghcr.io/lldpd/lldpd:latest + +In place of `latest` which provides you with the latest stable +version, you may use `1`, `1.0`, `1.0.12` to match specific versions, +or `master` to get the development version. + +To execute `lldpcli`, use: + + docker exec lldpd lldpcli show neighbors + +Or to get the command-line: + + docker exec -it lldpd lldpcli + +## Installation (macOS) The same procedure as above applies for macOS. However, there are simpler alternatives: @@ -111,50 +129,121 @@ user/group `_lldpd`. Have a look at how this is done in `osx/scripts/postinstall`. -Installation (Android) ----------------------- +## Installation (Android) -You need to download [Android NDK][] (version 22 or later). Once -unpacked, go inside the unpacked directory and select a toolchain, a -target, and an API level: - - export TOOLCHAIN=$PWD/toolchains/llvm/prebuilt/linux-x86_64 - export TARGET=aarch64-linux-android - export API=24 - -You need to export a bunch of variables: - - export AR=$TOOLCHAIN/bin/llvm-ar - export CC=$TOOLCHAIN/bin/$TARGET$API-clang - export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++ - export LD=$TOOLCHAIN/bin/ld - export RANLIB=$TOOLCHAIN/bin/llvm-ranlib - export STRIP=$TOOLCHAIN/bin/llvm-strip - export AS=$CC - -Then, you can build `lldpd` with the following commands: - - mkdir build && cd build - ../configure \ - --host=$TARGET \ - --with-sysroot=$TOOLCHAIN/sysroot \ - --prefix=/system \ - --sbindir=/system/bin \ - --runstatedir=/data/data/lldpd \ - --with-privsep-user=root \ - --with-privsep-group=root \ - PKG_CONFIG=/bin/false - make - make install DESTDIR=$PWD/install +1. Don't clone the repo or download the master branch from GitHub. Instead, download the official release from the website [https://lldpd.github.io/](https://lldpd.github.io/installation.html#install-from-source). Unpack into a working directory. + +2. Download the [Android NDK](https://developer.android.com/ndk/downloads#stable-downloads) (version 22 or later). Unpack into a working directory next to the `lldpd` directory. -Then, copy `install/system/bin/*` to `/system/bin` on the target -system and `install/system/lib/*.so*` to `/system/lib64` on the target -system. You may need to create `/data/data/lldpd` as well. +3. Install `automake`, `libtool`, and `pkg-config`. (`sudo apt-get install automake libtool pkg-config`) -[Android NDK]: https://developer.android.com/ndk +4. In the root of the `lldpd` directory, make a `compile.sh` file containing this script: +```sh +export TOOLCHAIN=$PWD/android-ndk/toolchains/llvm/prebuilt/linux-x86_64 +export TARGET=armv7a-linux-androideabi +export API=30 +# DO NOT TOUCH BELOW +export AR=$TOOLCHAIN/bin/llvm-ar +export CC=$TOOLCHAIN/bin/$TARGET$API-clang +export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++ +export LD=$TOOLCHAIN/bin/ld +export RANLIB=$TOOLCHAIN/bin/llvm-ranlib +export STRIP=$TOOLCHAIN/bin/llvm-strip +export AS=$CC +./autogen.sh +mkdir -p build && cd build +../configure \ + --host=$TARGET \ + --with-sysroot=$TOOLCHAIN/sysroot \ + --prefix=/system \ + --sbindir=/system/bin \ + --runstatedir=/data/data/lldpd \ + --with-privsep-user=root \ + --with-privsep-group=root \ + PKG_CONFIG=/bin/false +make +make install DESTDIR=$PWD/install +``` + +5. In the **Android NDK** directory, locate the `toolchains/llvm/prebuilt/linux-x86_64` directory and change the `TOOLCHAIN` variable of the above script to match the path where the `linux-x86_64` directory resides. + +```sh +export TOOLCHAIN=$PWD/android-ndk-r22b-linux-x86_64/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64 +``` + +6. Determine the CPU architecture target (`adb shell getprop ro.product.cpu.abi`). Change the `TARGET` variable in the above script to match the target architecture. The target name will not exactly match the output of the `adb` command as there will be a trailing suffix to the target name, so look in the `linux-x86_64/bin` directory for the `clang` file that starts with the CPU architecture target. Don't include the API version in the target name. +```sh +$ adb shell getprop ro.product.cpu.abi +armeabi-v7a +``` +```sh +linux-x86_64/bin$ ls *-clang +aarch64-linux-android21-clang armv7a-linux-androideabi23-clang i686-linux-android26-clang +aarch64-linux-android22-clang armv7a-linux-androideabi24-clang i686-linux-android27-clang +aarch64-linux-android23-clang armv7a-linux-androideabi26-clang i686-linux-android28-clang +aarch64-linux-android24-clang armv7a-linux-androideabi27-clang i686-linux-android29-clang +aarch64-linux-android26-clang armv7a-linux-androideabi28-clang i686-linux-android30-clang +aarch64-linux-android27-clang armv7a-linux-androideabi29-clang x86_64-linux-android21-clang +aarch64-linux-android28-clang armv7a-linux-androideabi30-clang x86_64-linux-android22-clang +aarch64-linux-android29-clang i686-linux-android16-clang x86_64-linux-android23-clang +aarch64-linux-android30-clang i686-linux-android17-clang x86_64-linux-android24-clang +armv7a-linux-androideabi16-clang i686-linux-android18-clang x86_64-linux-android26-clang +armv7a-linux-androideabi17-clang i686-linux-android19-clang x86_64-linux-android27-clang +armv7a-linux-androideabi18-clang i686-linux-android21-clang x86_64-linux-android28-clang +armv7a-linux-androideabi19-clang i686-linux-android22-clang x86_64-linux-android29-clang +armv7a-linux-androideabi21-clang i686-linux-android23-clang x86_64-linux-android30-clang +armv7a-linux-androideabi22-clang i686-linux-android24-clang +``` +```sh +export TARGET=armv7a-linux-androideabi +``` + +7. Set the `API` variable in the script above to your target API version. Check in the same `linux-x86_64/bin` to ensure the API you are targeting has a supported `clang` file for that CPU architecture and version. As of this writing, there is support for API `21-30` included for all architectures and some CPU architectures supported back to version `16`. +```sh +export API=30 +``` + +8. Run the compile script (`./compile.sh`). + +9. Copy the `./bin/*` and `./lib/*.so` files from `lldpd/build/install/system` to the target system (`./bin/*` to `/system/bin`, `./lib/*.so` to `/system/lib64`): +```sh +# Push files to target +cd build/install/system +adb shell mkdir -p /sdcard/Download/lldpd/bin +adb push bin/lldpcli /sdcard/Download/lldpd/bin/lldpcli +adb push bin/lldpd /sdcard/Download/lldpd/bin/lldpd +adb shell mkdir -p /sdcard/Download/lldpd/lib64 +adb push lib/liblldpctl.so /sdcard/Download/lldpd/lib64/liblldpctl.so + +# Enter target shell and move files +adb shell +# Run as root for all commands +$ su +# Make /system writeable +$ mount -o rw,remount /system +$ mv /sdcard/Download/lldpd/bin/lldpcli /system/bin/lldpcli +$ chmod 755 /system/bin/lldpcli +$ chown root:shell /system/bin/lldpcli +$ mv /sdcard/Download/lldpd/bin/lldpd /system/bin/lldpd +$ chmod 755 /system/bin/lldpd +$ chown root:shell /system/bin/lldpd +# $ touch /system/bin/lldpctl +# $ chmod 755 /system/bin/lldpctl +# $ chown root:shell /system/bin/lldpctl +$ mv /sdcard/Download/lldpd/lib64/liblldpctl.so /system/lib64/liblldpctl.so +$ chmod 644 /system/lib64/liblldpctl.so +$ chown root:root /system/lib64/liblldpctl.so +# Make /system readonly again +$ mount -o ro,remount /system +# Might not be necessary on some systems +$ mkdir /data/data/lldpd +$ chmod 700 /data/data/lldpd +$ chown shell:shell /data/data/lldpd +# Clean up +$ rm -rf /sdcard/Download/lldpd +``` -Usage ------ +## Usage lldpd also implements CDP (Cisco Discovery Protocol), FDP (Foundry Discovery Protocol), SONMP (Nortel Discovery Protocol) and EDP @@ -170,8 +259,7 @@ * http://standards.ieee.org/getieee802/download/802.1AB-2005.pdf * http://wiki.wireshark.org/LinkLayerDiscoveryProtocol -Compatibility with older kernels --------------------------------- +## Compatibility with older kernels If you have a kernel older than Linux 2.6.39, you need to compile lldpd with `--enable-oldies` to enable some compatibility functions: @@ -249,8 +337,7 @@ On modern networks, the performance impact should be nonexistent. -Development ------------ +## Development During development, you may want to execute lldpd at its current location instead of doing `make install`. The correct way to do this is @@ -290,8 +377,7 @@ --directory src --capture --output-file gcov.info genhtml gcov.info --output-directory coverage -Embedding ---------- +## Embedding To embed lldpd into an existing system, there are two point of entries: @@ -312,16 +398,14 @@ should always be shipped with `lldpd`. On the other hand, programs using `liblldpctl.so` can rely on the classic ABI rules. -Troubleshooting ---------------- +## Troubleshooting You can use `tcpdump` to look after the packets received and send by `lldpd`. To look after LLDPU, use: tcpdump -s0 -vv -pni eth0 ether dst 01:80:c2:00:00:0e -License -------- +## License lldpd is distributed under the ISC license: diff -Nru lldpd-1.0.11/aclocal.m4 lldpd-1.0.12/aclocal.m4 --- lldpd-1.0.11/aclocal.m4 2021-05-01 16:55:45.000000000 +0000 +++ lldpd-1.0.12/aclocal.m4 2021-08-20 20:27:40.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.4 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -296,7 +296,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -311,7 +311,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.3], [], +m4_if([$1], [1.16.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -327,12 +327,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.3])dnl +[AM_AUTOMAKE_VERSION([1.16.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -394,7 +394,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -446,7 +446,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -477,7 +477,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -668,7 +668,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -736,7 +736,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -800,7 +800,7 @@ [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -852,6 +852,20 @@ [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -933,7 +947,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -954,7 +968,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -976,7 +990,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1011,7 +1025,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1054,7 +1068,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1088,7 +1102,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1117,7 +1131,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1164,7 +1178,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1183,7 +1197,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1264,7 +1278,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1324,7 +1338,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1352,7 +1366,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1371,7 +1385,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru lldpd-1.0.11/ar-lib lldpd-1.0.12/ar-lib --- lldpd-1.0.11/ar-lib 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/ar-lib 2021-08-20 20:27:41.000000000 +0000 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2020 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff -Nru lldpd-1.0.11/compile lldpd-1.0.12/compile --- lldpd-1.0.11/compile 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/compile 2021-08-20 20:27:41.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff -Nru lldpd-1.0.11/configure lldpd-1.0.12/configure --- lldpd-1.0.11/configure 2021-05-01 16:55:46.000000000 +0000 +++ lldpd-1.0.12/configure 2021-08-20 20:27:40.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for lldpd 1.0.11. +# Generated by GNU Autoconf 2.69 for lldpd 1.0.12. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='lldpd' PACKAGE_TARNAME='lldpd' -PACKAGE_VERSION='1.0.11' -PACKAGE_STRING='lldpd 1.0.11' +PACKAGE_VERSION='1.0.12' +PACKAGE_STRING='lldpd 1.0.12' PACKAGE_BUGREPORT='https://github.com/lldpd/lldpd/issues' PACKAGE_URL='https://lldpd.github.io/' @@ -816,6 +816,9 @@ AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -1517,7 +1520,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lldpd 1.0.11 to adapt to many kinds of systems. +\`configure' configures lldpd 1.0.12 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1588,7 +1591,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lldpd 1.0.11:";; + short | recursive ) echo "Configuration of lldpd 1.0.12:";; esac cat <<\_ACEOF @@ -1805,7 +1808,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lldpd configure 1.0.11 +lldpd configure 1.0.12 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2285,7 +2288,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lldpd $as_me 1.0.11, which was +It was created by lldpd $as_me 1.0.12, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3154,7 +3157,7 @@ # Define the identity of the package. PACKAGE='lldpd' - VERSION='1.0.11' + VERSION='1.0.12' cat >>confdefs.h <<_ACEOF @@ -3320,6 +3323,20 @@ +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -23076,7 +23093,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lldpd $as_me 1.0.11, which was +This file was extended by lldpd $as_me 1.0.12, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23143,7 +23160,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -lldpd config.status 1.0.11 +lldpd config.status 1.0.12 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru lldpd-1.0.11/configure.ac lldpd-1.0.12/configure.ac --- lldpd-1.0.11/configure.ac 2021-01-27 18:33:15.000000000 +0000 +++ lldpd-1.0.12/configure.ac 2021-06-22 07:42:55.000000000 +0000 @@ -5,7 +5,7 @@ ### Base configuration # Configure autoconf -AC_PREREQ([2.64]) +AC_PREREQ([2.69]) AC_INIT([lldpd], [m4_esyscmd_s([./get-version])], @@ -49,7 +49,7 @@ AC_MSG_FAILURE([*** C99 support is mandatory]) fi AM_PROG_CC_C_O -AC_PROG_LIBTOOL +LT_INIT AC_PROG_LN_S AC_PROG_EGREP AC_PROG_AWK @@ -188,11 +188,10 @@ CFLAGS="$CFLAGS $libbsd_CFLAGS" LIBS="$LIBS $libbsd_LIBS" AC_MSG_CHECKING([if libbsd can be linked correctly]) - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include @%:@include - ],[], - [ + ]], [[]])],[ AC_MSG_RESULT(yes) LLDP_CFLAGS="$LLDP_CFLAGS $libbsd_CFLAGS" LLDP_LDFLAGS="$LLDP_LDFLAGS $libbsd_LIBS" diff -Nru lldpd-1.0.11/debian/changelog lldpd-1.0.12/debian/changelog --- lldpd-1.0.11/debian/changelog 2021-05-01 17:53:34.000000000 +0000 +++ lldpd-1.0.12/debian/changelog 2021-11-27 14:44:46.000000000 +0000 @@ -1,3 +1,17 @@ +lldpd (1.0.12-1+deb11u1) bullseye; urgency=high + + * d/patches: sonmp: fix heap overflow when reading SONMP packets. + CVE-2021-43612 + * d/patches: client: do not set VLAN tag if client did not set it + + -- Vincent Bernat Sat, 27 Nov 2021 15:44:46 +0100 + +lldpd (1.0.12-1) unstable; urgency=medium + + * New upstream release. + + -- Vincent Bernat Sun, 29 Aug 2021 08:52:15 +0200 + lldpd (1.0.11-1) unstable; urgency=medium * New upstream release. diff -Nru lldpd-1.0.11/debian/patches/0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch lldpd-1.0.12/debian/patches/0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch --- lldpd-1.0.11/debian/patches/0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch 1970-01-01 00:00:00.000000000 +0000 +++ lldpd-1.0.12/debian/patches/0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch 2021-11-27 14:44:46.000000000 +0000 @@ -0,0 +1,27 @@ +From 261afbe371ab316a4bf710338f6d9183a01e083f Mon Sep 17 00:00:00 2001 +From: Vincent Bernat +Date: Wed, 29 Sep 2021 12:02:15 +0200 +Subject: [PATCH] client: do not set VLAN tag if client did not set it + +This fixes a bug where frames could be tagged with VLAN 0 after client +configuration. +--- + src/daemon/client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/daemon/client.c b/src/daemon/client.c +index b4a08aae80a8..0d0f3ea37a19 100644 +--- a/src/daemon/client.c ++++ b/src/daemon/client.c +@@ -390,7 +390,7 @@ _client_handle_set_port(struct lldpd *cfg, + port->p_disable_rx = port->p_disable_tx = 1; + break; + } +- if (set->vlan_tx_enabled >= -1) { ++ if (set->vlan_tx_enabled > -1) { + port->p_vlan_tx_enabled = set->vlan_tx_enabled; + port->p_vlan_tx_tag = set->vlan_tx_tag; + } +-- +2.33.1 + diff -Nru lldpd-1.0.11/debian/patches/0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch lldpd-1.0.12/debian/patches/0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch --- lldpd-1.0.11/debian/patches/0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch 1970-01-01 00:00:00.000000000 +0000 +++ lldpd-1.0.12/debian/patches/0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch 2021-11-27 14:44:46.000000000 +0000 @@ -0,0 +1,93 @@ +From 73d42680fce8598324364dbb31b9bc3b8320adf7 Mon Sep 17 00:00:00 2001 +From: Vincent Bernat +Date: Sun, 19 Sep 2021 21:18:47 +0200 +Subject: [PATCH] sonmp: fix heap overflow when reading SONMP packets + +By sending short SONMP packets, an attacker can make the decoder crash +by reading too much data on the heap. SONMP packets are fixed in size, +just ensure we get the enough bytes to contain a SONMP packet. + +CVE-2021-43612 +--- + NEWS | 2 ++ + src/daemon/protocols/sonmp.c | 2 +- + src/daemon/protocols/sonmp.h | 2 +- + tests/check_sonmp.c | 10 +++++----- + 4 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/src/daemon/protocols/sonmp.c b/src/daemon/protocols/sonmp.c +index 41dcf6aa412d..f8f12469e28a 100644 +--- a/src/daemon/protocols/sonmp.c ++++ b/src/daemon/protocols/sonmp.c +@@ -311,7 +311,7 @@ sonmp_decode(struct lldpd *cfg, char *frame, int s, + + length = s; + pos = (u_int8_t*)frame; +- if (length < SONMP_SIZE) { ++ if (length < SONMP_SIZE + 2*ETHER_ADDR_LEN + sizeof(u_int16_t)) { + log_warnx("sonmp", "too short SONMP frame received on %s", hardware->h_ifname); + goto malformed; + } +diff --git a/src/daemon/protocols/sonmp.h b/src/daemon/protocols/sonmp.h +index 0e60106dae63..ff7a720f0b5d 100644 +--- a/src/daemon/protocols/sonmp.h ++++ b/src/daemon/protocols/sonmp.h +@@ -24,7 +24,7 @@ + #define LLC_ORG_NORTEL { 0x00, 0x00, 0x81 } + #define LLC_PID_SONMP_HELLO 0x01a2 + #define LLC_PID_SONMP_FLATNET 0x01a1 +-#define SONMP_SIZE (2*ETHER_ADDR_LEN + sizeof(u_int16_t) + 8) ++#define SONMP_SIZE 19 + + struct sonmp_chassis { + int type; +diff --git a/tests/check_sonmp.c b/tests/check_sonmp.c +index 8c7a208fffc1..b25f0e2fbb88 100644 +--- a/tests/check_sonmp.c ++++ b/tests/check_sonmp.c +@@ -33,7 +33,7 @@ START_TEST (test_send_sonmp) + IEEE 802.3 Ethernet + Destination: Bay-Networks-(Synoptics)-autodiscovery (01:00:81:00:01:00) + Source: 5e:10:8e:e7:84:ad (5e:10:8e:e7:84:ad) +- Length: 22 ++ Length: 19 + Logical-Link Control + DSAP: SNAP (0xaa) + IG Bit: Individual +@@ -55,7 +55,7 @@ Nortel Networks / SynOptics Network Management Protocol + IEEE 802.3 Ethernet + Destination: Bay-Networks-(Synoptics)-autodiscovery (01:00:81:00:01:01) + Source: 5e:10:8e:e7:84:ad (5e:10:8e:e7:84:ad) +- Length: 22 ++ Length: 19 + Logical-Link Control + DSAP: SNAP (0xaa) + IG Bit: Individual +@@ -76,13 +76,13 @@ Nortel Networks / SynOptics Network Management Protocol + */ + char pkt1[] = { + 0x01, 0x00, 0x81, 0x00, 0x01, 0x00, 0x5e, 0x10, +- 0x8e, 0xe7, 0x84, 0xad, 0x00, 0x16, 0xaa, 0xaa, ++ 0x8e, 0xe7, 0x84, 0xad, 0x00, 0x13, 0xaa, 0xaa, + 0x03, 0x00, 0x00, 0x81, 0x01, 0xa2, 0xac, 0x11, + 0x8e, 0x25, 0x00, 0x00, 0x04, 0x01, 0x0c, 0x03, + 0x01 }; + char pkt2[] = { + 0x01, 0x00, 0x81, 0x00, 0x01, 0x01, 0x5e, 0x10, +- 0x8e, 0xe7, 0x84, 0xad, 0x00, 0x16, 0xaa, 0xaa, ++ 0x8e, 0xe7, 0x84, 0xad, 0x00, 0x13, 0xaa, 0xaa, + 0x03, 0x00, 0x00, 0x81, 0x01, 0xa1, 0xac, 0x11, + 0x8e, 0x25, 0x00, 0x00, 0x04, 0x01, 0x0c, 0x03, + 0x01 }; +@@ -99,7 +99,7 @@ Nortel Networks / SynOptics Network Management Protocol + chassis.c_id_len = ETHER_ADDR_LEN; + TAILQ_INIT(&chassis.c_mgmt); + addr = inet_addr("172.17.142.37"); +- mgmt = lldpd_alloc_mgmt(LLDPD_AF_IPV4, ++ mgmt = lldpd_alloc_mgmt(LLDPD_AF_IPV4, + &addr, sizeof(in_addr_t), 0); + if (mgmt == NULL) + ck_abort(); +-- +2.33.1 + diff -Nru lldpd-1.0.11/debian/patches/series lldpd-1.0.12/debian/patches/series --- lldpd-1.0.11/debian/patches/series 2021-05-01 17:53:34.000000000 +0000 +++ lldpd-1.0.12/debian/patches/series 2021-11-27 14:44:46.000000000 +0000 @@ -1 +1,3 @@ 0001-build-put-ZSH-completion-in-vendor-completions.patch +0001-sonmp-fix-heap-overflow-when-reading-SONMP-packets.patch +0001-client-do-not-set-VLAN-tag-if-client-did-not-set-it.patch diff -Nru lldpd-1.0.11/depcomp lldpd-1.0.12/depcomp --- lldpd-1.0.11/depcomp 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/depcomp 2021-08-20 20:27:41.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru lldpd-1.0.11/libevent/Makefile.in lldpd-1.0.12/libevent/Makefile.in --- lldpd-1.0.11/libevent/Makefile.in 2021-05-01 16:55:42.000000000 +0000 +++ lldpd-1.0.12/libevent/Makefile.in 2021-08-20 20:27:37.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -658,9 +658,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ @@ -852,7 +849,7 @@ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing \ - $(top_srcdir)/build-aux/test-driver ChangeLog \ + $(top_srcdir)/build-aux/test-driver ChangeLog README.md \ build-aux/compile build-aux/config.guess build-aux/config.sub \ build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \ build-aux/missing epoll_sub.c @@ -888,6 +885,8 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -922,6 +921,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EV_LIB_GDI = @EV_LIB_GDI@ EV_LIB_WS32 = @EV_LIB_WS32@ EXEEXT = @EXEEXT@ @@ -2618,7 +2618,6 @@ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -2843,9 +2842,9 @@ @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +@ENABLE_DOXYGEN_FALSE@clean-local: @ENABLE_DOXYGEN_FALSE@install-data-local: @ENABLE_DOXYGEN_FALSE@uninstall-local: -@ENABLE_DOXYGEN_FALSE@clean-local: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ diff -Nru lldpd-1.0.11/libevent/aclocal.m4 lldpd-1.0.12/libevent/aclocal.m4 --- lldpd-1.0.11/libevent/aclocal.m4 2021-05-01 16:55:40.000000000 +0000 +++ lldpd-1.0.12/libevent/aclocal.m4 2021-08-20 20:27:36.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.4 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.3], [], +m4_if([$1], [1.16.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.3])dnl +[AM_AUTOMAKE_VERSION([1.16.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -400,7 +400,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -464,7 +464,7 @@ [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -516,6 +516,20 @@ [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -597,7 +611,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -618,7 +632,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -639,7 +653,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -682,7 +696,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -716,7 +730,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -745,7 +759,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -792,7 +806,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -811,7 +825,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -892,7 +906,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -952,7 +966,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -980,7 +994,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -999,7 +1013,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru lldpd-1.0.11/libevent/build-aux/compile lldpd-1.0.12/libevent/build-aux/compile --- lldpd-1.0.11/libevent/build-aux/compile 2021-05-01 16:55:42.000000000 +0000 +++ lldpd-1.0.12/libevent/build-aux/compile 2021-08-20 20:27:37.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff -Nru lldpd-1.0.11/libevent/build-aux/depcomp lldpd-1.0.12/libevent/build-aux/depcomp --- lldpd-1.0.11/libevent/build-aux/depcomp 2021-05-01 16:55:42.000000000 +0000 +++ lldpd-1.0.12/libevent/build-aux/depcomp 2021-08-20 20:27:37.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru lldpd-1.0.11/libevent/build-aux/missing lldpd-1.0.12/libevent/build-aux/missing --- lldpd-1.0.11/libevent/build-aux/missing 2021-05-01 16:55:42.000000000 +0000 +++ lldpd-1.0.12/libevent/build-aux/missing 2021-08-20 20:27:37.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru lldpd-1.0.11/libevent/build-aux/test-driver lldpd-1.0.12/libevent/build-aux/test-driver --- lldpd-1.0.11/libevent/build-aux/test-driver 2021-05-01 16:55:42.000000000 +0000 +++ lldpd-1.0.12/libevent/build-aux/test-driver 2021-08-20 20:27:37.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -105,8 +105,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -128,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -Nru lldpd-1.0.11/libevent/configure lldpd-1.0.12/libevent/configure --- lldpd-1.0.11/libevent/configure 2021-05-01 16:55:41.000000000 +0000 +++ lldpd-1.0.12/libevent/configure 2021-08-20 20:27:37.000000000 +0000 @@ -779,6 +779,9 @@ AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -3272,6 +3275,20 @@ +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile diff -Nru lldpd-1.0.11/m4/libevent.m4 lldpd-1.0.12/m4/libevent.m4 --- lldpd-1.0.11/m4/libevent.m4 2020-04-30 18:11:42.000000000 +0000 +++ lldpd-1.0.12/m4/libevent.m4 2021-06-22 07:42:55.000000000 +0000 @@ -20,13 +20,12 @@ _save_LIBS="$LIBS" CFLAGS="$CFLAGS $libevent_CFLAGS" LIBS="$LIBS $libevent_LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include @%:@include -@%:@include ], [ struct event_base *base = event_base_new(); event_new(base, -1, 0, NULL, NULL); ], - [ +@%:@include ]], [[ struct event_base *base = event_base_new(); event_new(base, -1, 0, NULL, NULL); ]])],[ AC_MSG_RESULT([yes]) - ], [ + ],[ if test x"$with_embedded_libevent" = x"auto"; then AC_MSG_RESULT([no, using shipped libevent]) LIBEVENT_EMBEDDED=1 diff -Nru lldpd-1.0.11/m4/progname.m4 lldpd-1.0.12/m4/progname.m4 --- lldpd-1.0.11/m4/progname.m4 2019-07-02 20:25:43.000000000 +0000 +++ lldpd-1.0.12/m4/progname.m4 2021-06-22 07:42:55.000000000 +0000 @@ -3,10 +3,11 @@ # AC_DEFUN([lldp_CHECK___PROGNAME],[ AC_CACHE_CHECK([whether libc defines __progname], lldp_cv_check___progname, [ - AC_TRY_LINK([], - [ extern char *__progname; printf("%s", __progname); ], - [ lldp_cv_check___progname="yes" ], - [ lldp_cv_check___progname="no" ]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[]], + [[ extern char *__progname; printf("%s", __progname); ]])], + [ lldp_cv_check___progname="yes" ], + [ lldp_cv_check___progname="no" ]) ]) if test x"$lldp_cv_check___progname" = x"yes"; then AC_DEFINE([HAVE___PROGNAME], [1], [Define if libc defines __progname]) diff -Nru lldpd-1.0.11/missing lldpd-1.0.12/missing --- lldpd-1.0.11/missing 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/missing 2021-08-20 20:27:41.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru lldpd-1.0.11/osx/Makefile.in lldpd-1.0.12/osx/Makefile.in --- lldpd-1.0.11/osx/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/osx/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -180,6 +180,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -215,6 +217,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -452,7 +455,6 @@ cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/Makefile.in lldpd-1.0.12/src/Makefile.in --- lldpd-1.0.11/src/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/src/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -222,8 +222,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -241,6 +239,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -276,6 +276,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -596,7 +597,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/client/Makefile.in lldpd-1.0.12/src/client/Makefile.in --- lldpd-1.0.11/src/client/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/src/client/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -253,8 +253,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/edit.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -273,6 +271,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -308,6 +308,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -1035,7 +1036,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/client/commands.c lldpd-1.0.12/src/client/commands.c --- lldpd-1.0.11/src/client/commands.c 2021-03-21 12:54:52.000000000 +0000 +++ lldpd-1.0.12/src/client/commands.c 2021-05-04 19:53:46.000000000 +0000 @@ -19,8 +19,11 @@ #include #include #include +#include +#include #include #include +#include /** * An element of the environment (a key and a value). @@ -372,6 +375,7 @@ .argp = 0 }; static int lockfd = -1; + static char *lockname = NULL; /* Name of lockfile */ cmdenv_push(&env, root); if (!completion) for (n = 0; n < argc; n++) @@ -445,26 +449,25 @@ /* Push and execute */ cmdenv_push(&env, best); if (best->execute) { - struct sockaddr_un su; if (needlock) { if (lockfd == -1) { - log_debug("lldpctl", "reopen %s for locking", ctlname); - if ((lockfd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) { - log_warn("lldpctl", "cannot open for lock %s", ctlname); + if (lockname == NULL && + asprintf(&lockname, "%s.lock", + ctlname) == -1) { + log_warnx("lldpctl", + "not enough memory to build lock filename"); rc = -1; goto end; } - su.sun_family = AF_UNIX; - strlcpy(su.sun_path, ctlname, sizeof(su.sun_path)); - if (connect(lockfd, (struct sockaddr *)&su, sizeof(struct sockaddr_un)) == -1) { - log_warn("lldpctl", "cannot connect to socket %s", ctlname); + log_debug("lldpctl", "open %s for locking", lockname); + if ((lockfd = open(lockname, O_RDWR)) == -1) { + log_warn("lldpctl", "cannot open lock %s", lockname); rc = -1; - close(lockfd); lockfd = -1; goto end; } } if (lockf(lockfd, F_LOCK, 0) == -1) { - log_warn("lldpctl", "cannot get lock on %s", ctlname); + log_warn("lldpctl", "cannot get lock on %s", lockname); rc = -1; close(lockfd); lockfd = -1; goto end; @@ -472,7 +475,7 @@ } rc = best->execute(conn, w, &env, best->arg) != 1 ? -1 : rc; if (needlock && lockf(lockfd, F_ULOCK, 0) == -1) { - log_warn("lldpctl", "cannot unlock %s", ctlname); + log_warn("lldpctl", "cannot unlock %s", lockname); close(lockfd); lockfd = -1; } if (rc == -1) goto end; diff -Nru lldpd-1.0.11/src/client/conf-power.c lldpd-1.0.12/src/client/conf-power.c --- lldpd-1.0.11/src/client/conf-power.c 2020-04-30 18:11:42.000000000 +0000 +++ lldpd-1.0.12/src/client/conf-power.c 2021-06-04 16:54:53.000000000 +0000 @@ -121,7 +121,7 @@ /* Powerpairs */ (what = "power pairs", lldpctl_atom_set_str(dot3_power, lldpctl_k_dot3_power_pairs, - cmdenv_get(env, "powerpairs")?cmdenv_get(env, "powerpairs"):"unknown")) == NULL || + cmdenv_get(env, "powerpairs"))) == NULL || /* Class */ (what = "power class", cmdenv_get(env, "class")? lldpctl_atom_set_str(dot3_power, @@ -304,11 +304,10 @@ static int cmd_check_env_power(struct cmd_env *env, void *nothing) { - /* We need type. If we type is PSE, we need powerpairs. If we have - * typeat, we also request source, priority, requested and allocated. */ + /* We need type and powerpair but if we have typeat, we also request + * source, priority, requested and allocated. */ if (!cmdenv_get(env, "device-type")) return 0; - if (!strcmp(cmdenv_get(env, "device-type"), "pse") && - !cmdenv_get(env, "powerpairs")) return 0; + if (!cmdenv_get(env, "powerpairs")) return 0; if (cmdenv_get(env, "typeat")) { return (!!cmdenv_get(env, "source") && !!cmdenv_get(env, "priority") && @@ -361,8 +360,8 @@ /* Power pairs */ struct cmd_node *powerpairs = commands_new( configure_dot3power, - "powerpairs", "Which pairs are currently used for power", - cmd_check_pse, NULL, "powerpairs"); + "powerpairs", "Which pairs are currently used for power (mandatory)", + cmd_check_type_but_no, NULL, "powerpairs"); for (lldpctl_map_t *pp_map = lldpctl_key_get_map(lldpctl_k_dot3_power_pairs); pp_map->string; diff -Nru lldpd-1.0.11/src/client/display.c lldpd-1.0.12/src/client/display.c --- lldpd-1.0.11/src/client/display.c 2021-03-01 09:39:55.000000000 +0000 +++ lldpd-1.0.12/src/client/display.c 2021-06-04 16:54:53.000000000 +0000 @@ -446,13 +446,10 @@ tag_data(w, lldpctl_atom_get_str(dot3_power, lldpctl_k_dot3_power_devicetype));; tag_end(w); - if (lldpctl_atom_get_int(dot3_power, - lldpctl_k_dot3_power_devicetype) == LLDP_DOT3_POWER_PSE) { - tag_start(w, "pairs", "Power pairs"); - tag_data(w, lldpctl_atom_get_str(dot3_power, - lldpctl_k_dot3_power_pairs)); - tag_end(w); - } + tag_start(w, "pairs", "Power pairs"); + tag_data(w, lldpctl_atom_get_str(dot3_power, + lldpctl_k_dot3_power_pairs)); + tag_end(w); tag_start(w, "class", "Class"); tag_data(w, lldpctl_atom_get_str(dot3_power, lldpctl_k_dot3_power_class)); diff -Nru lldpd-1.0.11/src/client/lldpcli.8.in lldpd-1.0.12/src/client/lldpcli.8.in --- lldpd-1.0.11/src/client/lldpcli.8.in 2021-01-02 18:42:41.000000000 +0000 +++ lldpd-1.0.12/src/client/lldpcli.8.in 2021-06-04 16:54:53.000000000 +0000 @@ -922,7 +922,7 @@ .Op Cd supported .Op Cd enabled .Op Cd paircontrol -.Op Cd powerpairs Ar powerpairs +.Cd powerpairs Ar powerpairs .Op Cd class Ar class .Op Cd type Ar type Cd source Ar source Cd priority Ar priority Cd requested Ar requested Cd allocated Ar allocated .Bd -ragged -offset XXXXXX diff -Nru lldpd-1.0.11/src/compat/Makefile.in lldpd-1.0.12/src/compat/Makefile.in --- lldpd-1.0.11/src/compat/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/src/compat/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -186,8 +186,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ asprintf.c daemon.c getline.c malloc.c realloc.c \ setproctitle.c strlcpy.c strndup.c strnlen.c strtonum.c \ @@ -208,6 +206,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -243,6 +243,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -538,7 +539,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/daemon/Makefile.in lldpd-1.0.12/src/daemon/Makefile.in --- lldpd-1.0.11/src/daemon/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/src/daemon/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -403,8 +403,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/edit.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -423,6 +421,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -458,6 +458,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -1264,7 +1265,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/daemon/lldpd.c lldpd-1.0.12/src/daemon/lldpd.c --- lldpd-1.0.11/src/daemon/lldpd.c 2021-03-21 14:39:18.000000000 +0000 +++ lldpd-1.0.12/src/daemon/lldpd.c 2021-05-04 20:05:11.000000000 +0000 @@ -1309,12 +1309,17 @@ static void lldpd_exit(struct lldpd *cfg) { + char *lockname = NULL; struct lldpd_hardware *hardware, *hardware_next; log_debug("main", "exit lldpd"); TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) lldpd_send_shutdown(hardware); + if (asprintf(&lockname, "%s.lock", cfg->g_ctlname) != -1) { + priv_ctl_cleanup(lockname); + free(lockname); + } close(cfg->g_ctl); priv_ctl_cleanup(cfg->g_ctlname); log_debug("main", "cleanup hardware information"); @@ -1797,6 +1802,24 @@ log_warn("main", "unable to chmod control socket"); #endif + /* Create associated advisory lock file */ + char *lockname = NULL; + int fd; + if (asprintf(&lockname, "%s.lock", ctlname) == -1) + fatal("main", "cannot build lock name"); + if ((fd = open(lockname, O_CREAT|O_RDWR, 0000)) == -1) + fatal("main", "cannot create lock file for control socket"); + close(fd); +#ifdef ENABLE_PRIVSEP + if (chown(lockname, uid, gid) == -1) + log_warn("main", "unable to chown control socket lock"); + if (chmod(lockname, + S_IRUSR | S_IWUSR | S_IXUSR | + S_IRGRP | S_IWGRP | S_IXGRP) == -1) + log_warn("main", "unable to chmod control socket lock"); +#endif + free(lockname); + /* Disable SIGPIPE */ signal(SIGPIPE, SIG_IGN); diff -Nru lldpd-1.0.11/src/lib/Makefile.in lldpd-1.0.12/src/lib/Makefile.in --- lldpd-1.0.11/src/lib/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/src/lib/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -238,8 +238,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/edit.am DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -258,6 +256,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -293,6 +293,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -741,7 +742,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff -Nru lldpd-1.0.11/src/lib/atoms/dot3.c lldpd-1.0.12/src/lib/atoms/dot3.c --- lldpd-1.0.11/src/lib/atoms/dot3.c 2021-03-08 21:06:59.000000000 +0000 +++ lldpd-1.0.12/src/lib/atoms/dot3.c 2021-06-04 16:54:53.000000000 +0000 @@ -48,7 +48,6 @@ static struct atom_map port_dot3_power_pairs_map = { .key = lldpctl_k_dot3_power_pairs, .map = { - { 0, "unknown" }, { LLDP_DOT3_POWERPAIRS_SIGNAL, "signal" }, { LLDP_DOT3_POWERPAIRS_SPARE, "spare" }, { 0, NULL } @@ -388,7 +387,6 @@ } case lldpctl_k_dot3_power_pairs: switch (value) { - case 0: case 1: case 2: port->p_power.pairs = value; diff -Nru lldpd-1.0.11/test-driver lldpd-1.0.12/test-driver --- lldpd-1.0.11/test-driver 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/test-driver 2021-08-20 20:27:41.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -105,8 +105,11 @@ trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 -# Test script is run here. -"$@" >$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -128,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -Nru lldpd-1.0.11/tests/Makefile.in lldpd-1.0.12/tests/Makefile.in --- lldpd-1.0.11/tests/Makefile.in 2021-05-01 16:55:48.000000000 +0000 +++ lldpd-1.0.12/tests/Makefile.in 2021-08-20 20:27:41.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -301,8 +301,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -526,6 +524,8 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -561,6 +561,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ @@ -1146,7 +1147,6 @@ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am