Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lldpd for openSUSE:Factory checked in at 2021-08-23 10:08:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lldpd (Old) and /work/SRC/openSUSE:Factory/.lldpd.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lldpd" Mon Aug 23 10:08:25 2021 rev:18 rq:913600 version:1.0.12 Changes: -------- --- /work/SRC/openSUSE:Factory/lldpd/lldpd.changes 2021-05-03 22:08:39.056368040 +0200 +++ /work/SRC/openSUSE:Factory/.lldpd.new.1899/lldpd.changes 2021-08-23 10:09:52.832126703 +0200 @@ -1,0 +2,11 @@ +Fri Aug 20 19:12:07 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to version 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. +- Fix URL + +------------------------------------------------------------------- Old: ---- lldpd-1.0.11.tar.gz lldpd-1.0.11.tar.gz.asc New: ---- lldpd-1.0.12.tar.gz lldpd-1.0.12.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lldpd.spec ++++++ --- /var/tmp/diff_new_pack.rAWyqs/_old 2021-08-23 10:09:53.300126157 +0200 +++ /var/tmp/diff_new_pack.rAWyqs/_new 2021-08-23 10:09:53.304126151 +0200 @@ -26,17 +26,17 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: lldpd -Version: 1.0.11 +Version: 1.0.12 Release: 0 Summary: Implementation of IEEE 802.1ab (LLDP) # We have some GPL linux headers in include/linux, they are used on # platforms where glibc headers are not recent enough License: GPL-2.0-or-later AND ISC Group: System/Daemons -URL: http://vincentbernat.github.com/lldpd/ -Source0: http://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz +URL: https://vincentbernat.github.io/ +Source0: https://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz Source1: lldpd.sysconfig -Source2: http://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz.gpg#/%{name}-%{version}.tar.gz.asc +Source2: https://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz.gpg#/%{name}-%{version}.tar.gz.asc Source3: http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x95A42FE8353525F9#/%{name}.keyring BuildRequires: net-snmp-devel BuildRequires: openssl-devel ++++++ lldpd-1.0.11.tar.gz -> lldpd-1.0.12.tar.gz ++++++ ++++ 1803 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/.dist-version new/lldpd-1.0.12/.dist-version --- old/lldpd-1.0.11/.dist-version 2021-05-01 18:56:02.000000000 +0200 +++ new/lldpd-1.0.12/.dist-version 2021-08-20 22:27:55.000000000 +0200 @@ -1 +1 @@ -1.0.11 +1.0.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/ChangeLog new/lldpd-1.0.12/ChangeLog --- old/lldpd-1.0.11/ChangeLog 2021-05-01 18:56:01.000000000 +0200 +++ new/lldpd-1.0.12/ChangeLog 2021-08-20 22:27:54.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/NEWS new/lldpd-1.0.12/NEWS --- old/lldpd-1.0.11/NEWS 2021-04-27 22:57:48.000000000 +0200 +++ new/lldpd-1.0.12/NEWS 2021-08-20 22:24:35.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/README.md new/lldpd-1.0.12/README.md --- old/lldpd-1.0.11/README.md 2021-04-27 22:40:58.000000000 +0200 +++ new/lldpd-1.0.12/README.md 2021-06-22 09:42:55.000000000 +0200 @@ -1,12 +1,10 @@ -lldpd: implementation of IEEE 802.1ab (LLDP) -============================================ +# lldpd: implementation of IEEE 802.1ab (LLDP)  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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/ar-lib new/lldpd-1.0.12/ar-lib --- old/lldpd-1.0.11/ar-lib 2021-05-01 18:55:48.000000000 +0200 +++ new/lldpd-1.0.12/ar-lib 2021-08-20 22:27:41.000000000 +0200 @@ -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 <p...@lysator.liu.se>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/compile new/lldpd-1.0.12/compile --- old/lldpd-1.0.11/compile 2021-05-01 18:55:48.000000000 +0200 +++ new/lldpd-1.0.12/compile 2021-08-20 22:27:41.000000000 +0200 @@ -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 <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/configure.ac new/lldpd-1.0.12/configure.ac --- old/lldpd-1.0.11/configure.ac 2021-01-27 19:33:15.000000000 +0100 +++ new/lldpd-1.0.12/configure.ac 2021-06-22 09:42:55.000000000 +0200 @@ -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 <sys/time.h> @%:@include <sys/types.h> - ],[], - [ + ]], [[]])],[ AC_MSG_RESULT(yes) LLDP_CFLAGS="$LLDP_CFLAGS $libbsd_CFLAGS" LLDP_LDFLAGS="$LLDP_LDFLAGS $libbsd_LIBS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/libevent/build-aux/compile new/lldpd-1.0.12/libevent/build-aux/compile --- old/lldpd-1.0.11/libevent/build-aux/compile 2021-05-01 18:55:42.000000000 +0200 +++ new/lldpd-1.0.12/libevent/build-aux/compile 2021-08-20 22:27:37.000000000 +0200 @@ -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 <tro...@cygnus.com>. # # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/libevent/build-aux/missing new/lldpd-1.0.12/libevent/build-aux/missing --- old/lldpd-1.0.11/libevent/build-aux/missing 2021-05-01 18:55:42.000000000 +0200 +++ new/lldpd-1.0.12/libevent/build-aux/missing 2021-08-20 22:27:37.000000000 +0200 @@ -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 <pin...@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/libevent/build-aux/test-driver new/lldpd-1.0.12/libevent/build-aux/test-driver --- old/lldpd-1.0.11/libevent/build-aux/test-driver 2021-05-01 18:55:42.000000000 +0200 +++ new/lldpd-1.0.12/libevent/build-aux/test-driver 2021-08-20 22:27:37.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/m4/libevent.m4 new/lldpd-1.0.12/m4/libevent.m4 --- old/lldpd-1.0.11/m4/libevent.m4 2020-04-30 20:11:42.000000000 +0200 +++ new/lldpd-1.0.12/m4/libevent.m4 2021-06-22 09:42:55.000000000 +0200 @@ -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 <sys/time.h> @%:@include <sys/types.h> -@%:@include <event2/event.h>], [ struct event_base *base = event_base_new(); event_new(base, -1, 0, NULL, NULL); ], - [ +@%:@include <event2/event.h>]], [[ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/m4/progname.m4 new/lldpd-1.0.12/m4/progname.m4 --- old/lldpd-1.0.11/m4/progname.m4 2019-07-02 22:25:43.000000000 +0200 +++ new/lldpd-1.0.12/m4/progname.m4 2021-06-22 09:42:55.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/missing new/lldpd-1.0.12/missing --- old/lldpd-1.0.11/missing 2021-05-01 18:55:48.000000000 +0200 +++ new/lldpd-1.0.12/missing 2021-08-20 22:27:41.000000000 +0200 @@ -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 <pin...@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/client/commands.c new/lldpd-1.0.12/src/client/commands.c --- old/lldpd-1.0.11/src/client/commands.c 2021-03-21 13:54:52.000000000 +0100 +++ new/lldpd-1.0.12/src/client/commands.c 2021-05-04 21:53:46.000000000 +0200 @@ -19,8 +19,11 @@ #include <string.h> #include <sys/queue.h> #include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> #include <sys/socket.h> #include <sys/un.h> +#include <libgen.h> /** * 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/client/conf-power.c new/lldpd-1.0.12/src/client/conf-power.c --- old/lldpd-1.0.11/src/client/conf-power.c 2020-04-30 20:11:42.000000000 +0200 +++ new/lldpd-1.0.12/src/client/conf-power.c 2021-06-04 18:54:53.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/client/display.c new/lldpd-1.0.12/src/client/display.c --- old/lldpd-1.0.11/src/client/display.c 2021-03-01 10:39:55.000000000 +0100 +++ new/lldpd-1.0.12/src/client/display.c 2021-06-04 18:54:53.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/client/lldpcli.8.in new/lldpd-1.0.12/src/client/lldpcli.8.in --- old/lldpd-1.0.11/src/client/lldpcli.8.in 2021-01-02 19:42:41.000000000 +0100 +++ new/lldpd-1.0.12/src/client/lldpcli.8.in 2021-06-04 18:54:53.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/daemon/lldpd.c new/lldpd-1.0.12/src/daemon/lldpd.c --- old/lldpd-1.0.11/src/daemon/lldpd.c 2021-03-21 15:39:18.000000000 +0100 +++ new/lldpd-1.0.12/src/daemon/lldpd.c 2021-05-04 22:05:11.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/src/lib/atoms/dot3.c new/lldpd-1.0.12/src/lib/atoms/dot3.c --- old/lldpd-1.0.11/src/lib/atoms/dot3.c 2021-03-08 22:06:59.000000000 +0100 +++ new/lldpd-1.0.12/src/lib/atoms/dot3.c 2021-06-04 18:54:53.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/lldpd-1.0.11/test-driver new/lldpd-1.0.12/test-driver --- old/lldpd-1.0.11/test-driver 2021-05-01 18:55:48.000000000 +0200 +++ new/lldpd-1.0.12/test-driver 2021-08-20 22:27:41.000000000 +0200 @@ -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"