Hello community, here is the log from the commit of package lldpd for openSUSE:Factory checked in at 2018-04-20 17:26:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lldpd (Old) and /work/SRC/openSUSE:Factory/.lldpd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lldpd" Fri Apr 20 17:26:22 2018 rev:4 rq:595110 version:1.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/lldpd/lldpd.changes 2017-12-19 10:59:13.099233525 +0100 +++ /work/SRC/openSUSE:Factory/.lldpd.new/lldpd.changes 2018-04-20 17:26:34.876824442 +0200 @@ -1,0 +2,22 @@ +Mon Apr 9 16:38:43 UTC 2018 - [email protected] + +- Update to version 1.0.1 + * Use "mkdir -p" instead of "mkdir" in systemd unit. + +------------------------------------------------------------------- +Mon Apr 9 07:25:19 UTC 2018 - [email protected] + +- Update to version 1.0.0 + * Changes: + + Chassis ID can be set to an arbitrary value with "configure + system chassisid". + + Port description can be overriden directly with "configure + lldp portdescription". + + Command "configure system interface permanent" enables one to + specify a pattern for interfaces to be kept in memory even when + they are removed from the system. + * Fix: + + Ensure chassis-related changes are propagated immediately. + + Ensure management address change is correctly detected. + +------------------------------------------------------------------- Old: ---- lldpd-0.9.9.tar.gz lldpd-0.9.9.tar.gz.asc New: ---- lldpd-1.0.1.tar.gz lldpd-1.0.1.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lldpd.spec ++++++ --- /var/tmp/diff_new_pack.7kf07f/_old 2018-04-20 17:26:35.788791372 +0200 +++ /var/tmp/diff_new_pack.7kf07f/_new 2018-04-20 17:26:35.792791227 +0200 @@ -41,7 +41,7 @@ %bcond_without system_libevent %bcond_with seccomp Name: lldpd -Version: 0.9.9 +Version: 1.0.1 Release: 0 Summary: Implementation of IEEE 802.1ab (LLDP) # We have some GPL linux headers in include/linux, they are used on ++++++ lldpd-0.9.9.tar.gz -> lldpd-1.0.1.tar.gz ++++++ ++++ 8461 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-0.9.9/.dist-version new/lldpd-1.0.1/.dist-version --- old/lldpd-0.9.9/.dist-version 2017-11-21 15:19:16.000000000 +0100 +++ new/lldpd-1.0.1/.dist-version 2018-04-09 13:53:10.000000000 +0200 @@ -1 +1 @@ -0.9.9 +1.0.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-0.9.9/ChangeLog new/lldpd-1.0.1/ChangeLog --- old/lldpd-0.9.9/ChangeLog 2017-11-21 15:19:15.000000000 +0100 +++ new/lldpd-1.0.1/ChangeLog 2018-04-09 13:53:09.000000000 +0200 @@ -1,5 +1,57 @@ -0.9.9 [2017-11-21 15:15:55 +0100]: +1.0.1 [2018-04-09 13:44:08 +0200]: + - [4ff8626eced9] release: 1.0.1 (Vincent Bernat) + - [c0dd6678ef93] daemon: use "mkdir -p" instead of "mkdir" (Vincent Bernat) + - [05455522fdd5] Revert "daemon: use RuntimeDirectory= instead of mkdir to create chroot" (Vincent Bernat) + - [478ec07ddc34] daemon: use RuntimeDirectory= instead of mkdir to create chroot (Vincent Bernat) + - [c560c1ca38c6] build: try another way to circumvent macOS warning in libevent (Vincent Bernat) + - [e72186255180] build: also build with embedded libevent in OSX (Vincent Bernat) + - [eb779d02e144] build: don't be picky about deprecated stuff in libevent (Vincent Bernat) + +1.0.0 [2018-04-08 18:30:57 +0200]: + + - [99a0b07d3288] release: prepare 1.0.0 (Vincent Bernat) + - [f9da7943df17] Merge pull request #274 from vincentbernat/feature/keep-some-ports (Vincent Bernat) + - [474c5baabeaa] Merge pull request #272 from westermo/fix-snmp-remTablesLastChange (Vincent Bernat) + - [0a78e14f8795] lldpd: add an option to keep some specified ports (Vincent Bernat) + - [246d153846ab] tests: update tests for configuration keeping on port down/removed (Vincent Bernat) + - [dc9869ef11ae] client: remove previous way to set port description from documentation (Vincent Bernat) + - [5dd953f435ce] test: add test for new portdescription setting (Vincent Bernat) + - [8505c2956a74] interfaces: fix out-of-bound access when getting permanent MAC address (Vincent Bernat) + - [989d5a545ab8] tests: don't crash if lldpd crashed (Vincent Bernat) + - [b2efcec15fa9] Merge pull request #273 from westermo/config-portdescr (Vincent Bernat) + - [3d96ef666437] doc: add entry for portdescription in lldpcli manual page (Jonas Johansson) + - [e180a95331f5] client: add alternative way to configure port description (Thomas Eliasson) + - [c79467f68440] handle lldpStatsRemTablesLastChangeTime correctly when items are removed (Thomas Eliasson) + - [878441b274a7] netlink: fix non-updated management address (Vincent Bernat) + - [d43d79d37005] daemon: ensure interval update is taken into account fast (Vincent Bernat) + - [12e08b95e087] Merge pull request #271 from axjowa/fix/dot3-pd-pse-echo (Vincent Bernat) + - [f474adabbb43] Fix NULL pointer dereference in lldpd_dot3_power_pd_pse (axjowa) + - [2e472ccaceb4] build: don't enable sanitizers and safe-stack at the same time (Vincent Bernat) + - [c4c9f15a7d1f] interfaces: explain why we cannot get the permanent MAC address (Vincent Bernat) + - [3d5ba074330e] build: isolate SNMP-related files during compilation (Vincent Bernat) + - [7742be399cd4] lib: lldpctl_k_config_paused is writable (Vincent Bernat) + - [7edd995b5c82] doc: add ./autogen.sh to build instructions (Vincent Bernat) + - [78e60be7e785] osx: use "squiggly" heredoc (Vincent Bernat) + - [b3621e5e7611] Merge pull request #266 from dennypage/master (Vincent Bernat) + - [384f5f59a58c] Add missing options to usage (Denny Page) + - [0e5197c8174a] client: change description for chassis ID override (Vincent Bernat) + - [f36b76c1aff7] daemon: move vfork/fork handling directly in lldpd.c (Vincent Bernat) + - [438d3fa6e55e] Merge pull request #263 from vic-lin-accton/master (Vincent Bernat) + - [8481f4905029] lib: ability to configure a local chassis ID (Vincent Bernat) + - [e6f64ed93e6c] daemon: ensure chassis-related changes are updated immediately (Vincent Bernat) + - [d80641ac57f6] lib: move new lldpctl_k_config_cid_string to end of section (Vincent Bernat) + - [5660759bdf27] lldpd: check for defined string before use chassis name for chassis id (vic_lin) + - [acbb798a2d28] osx: update Homebrew formula (Vincent Bernat) + - [b0ca585f627a] daemon: don't use @mkdir_p@ substitution for systemd service file (Vincent Bernat) + - [1f73fc1ad7ed] configure: remove check on CXX compiler (Damien Riegel) + - [db4383ddb33d] doc: add a word about Intel X710 with embedded LLDP daemon (Vincent Bernat) + - [ac57139f73d5] doc: rename OS X to macOS (Vincent Bernat) + - [ae6cb83f9d5e] LICENSE: add title and copyright notice (#259) (Waldir Pimenta) + +0.9.9 [2017-11-21 16:42:46 +0100]: + + - [0f552e2b1616] release: force S3 deployment whatever the branch is (Vincent Bernat) - [722f74c45545] release: prepare 0.9.9 (Vincent Bernat) - [1e33fa1d2cf4] dot3: as PD device, echo back PSE allocated value (Vincent Bernat) - [b941efa675ad] travis: upload OSX build to some S3 bucket (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-0.9.9/LICENSE new/lldpd-1.0.1/LICENSE --- old/lldpd-0.9.9/LICENSE 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/LICENSE 2017-12-09 23:34:51.000000000 +0100 @@ -1,3 +1,11 @@ +The license below applies to most, but not all content in this project. +Files with different licensing and authorship terms are marked as such. +That information must be considered when ensuring licensing compliance. + +ISC License + +Copyright (c) 2008-2017, Vincent Bernat <[email protected]> + Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 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-0.9.9/NEWS new/lldpd-1.0.1/NEWS --- old/lldpd-0.9.9/NEWS 2017-11-21 07:18:19.000000000 +0100 +++ new/lldpd-1.0.1/NEWS 2018-04-09 13:44:05.000000000 +0200 @@ -1,3 +1,20 @@ +lldpd (1.0.1) + * Fix: + + Use "mkdir -p" instead of "mkdir" in systemd unit. + +lldpd (1.0.0) + * Changes: + + Chassis ID can be set to an arbitrary value with "configure system + chassisid". + + Port description can be overriden directly with "configure lldp + portdescription". + + Command "configure system interface permanent" enables one to + specify a pattern for interfaces to be kept in memory even when + they are removed from the system. + * Fix: + + Ensure chassis-related changes are propagated immediately. + + Ensure management address change is correctly detected. + lldpd (0.9.9) * Changes: + lldpcli can now display local interfaces with LLDP data sent on 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-0.9.9/README.md new/lldpd-1.0.1/README.md --- old/lldpd-0.9.9/README.md 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/README.md 2018-02-07 09:08:01.000000000 +0100 @@ -26,7 +26,7 @@ * FreeBSD * GNU/Linux - * OS X + * macOS * NetBSD * OpenBSD * Solaris @@ -38,11 +38,13 @@ Installation ------------ -For general instructions -[see the website](http://vincentbernat.github.io/lldpd/installation.html). +For general instructions [prefer the +website](http://vincentbernat.github.io/lldpd/installation.html), +including building from released tarballs. -To compile lldpd from sources, use the following: +To compile lldpd from Git, use the following commands: + ./autogen.sh ./configure make sudo make install @@ -60,10 +62,10 @@ line. If you don't want to run it as root, just install it setuid or setgid `_lldpd`. -Installation (OS X) +Installation (macOS) ----------------------- -The same procedure as above applies for OS X. However, there are +The same procedure as above applies for macOS. However, there are simpler alternatives: 1. Use [Homebrew](https://brew.sh): @@ -72,15 +74,15 @@ # Or, for the latest version: brew install https://raw.github.com/vincentbernat/lldpd/master/osx/lldpd.rb - 2. Build an OS X installer package which should work on the same - version of OS X: + 2. Build an macOS installer package which should work on the same + version of macOS: mkdir build && cd build ../configure --prefix=/usr/local --localstatedir=/var --sysconfdir=/private/etc --with-embedded-libevent \ --without-snmp make -C osx pkg - If you want to compile for an older version of OS X, you need + If you want to compile for an older version of macOS, you need to find the right SDK and issues commands like those: SDK=/Developer/SDKs/MacOSX10.6.sdk @@ -298,6 +300,14 @@ tcpdump -s0 -vv -pni eth0 ether dst 01:80:c2:00:00:0e +Intel X710 cards may handle LLDP themselves, intercepting any incoming +packets. If you don't see anything through `tcpdump`, check if you +have such a card (with `lspci`) and stop the embedded LLDP daemon: + + for f in /sys/kernel/debug/i40e/*/command; do + echo lldp stop > $f + done + 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-0.9.9/config.h.in new/lldpd-1.0.1/config.h.in --- old/lldpd-0.9.9/config.h.in 2017-11-21 15:18:41.000000000 +0100 +++ new/lldpd-1.0.1/config.h.in 2018-04-09 13:51:24.000000000 +0200 @@ -213,7 +213,7 @@ /* Host operating system is OpenBSD */ #undef HOST_OS_OPENBSD -/* Host operating system is OS X */ +/* Host operating system is macOS */ #undef HOST_OS_OSX /* Host operating system is Solaris */ 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-0.9.9/configure.ac new/lldpd-1.0.1/configure.ac --- old/lldpd-0.9.9/configure.ac 2017-09-28 15:34:38.000000000 +0200 +++ new/lldpd-1.0.1/configure.ac 2018-03-23 13:44:25.000000000 +0100 @@ -48,7 +48,6 @@ if test x"$ac_cv_prog_cc_c99" = x"no"; then AC_MSG_FAILURE([*** C99 support is mandatory]) fi -AC_PROG_CXX AM_PROG_CC_C_O AC_PROG_LIBTOOL AC_PROG_LN_S @@ -110,10 +109,6 @@ AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-fstack-protector-strong], [LLDP_CFLAGS]) AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2], [LLDP_CPPFLAGS]) - AX_LDFLAGS_OPTION([-fsanitize=safe-stack], [LLDP_BIN_LDFLAGS]) - if test x"$ax_cv_ld_check_flag__fsanitize_safe_stack" != x"no"; then - AX_CFLAGS_GCC_OPTION([-fsanitize=safe-stack], [LLDP_CFLAGS]) - fi fi if test x"$pie" = x"yes"; then AX_CFLAGS_GCC_OPTION([-fPIE], [LLDP_CFLAGS]) @@ -135,6 +130,11 @@ LLDP_CFLAGS="$LLDP_CFLAGS $sanitizers" LLDP_LDFLAGS="$LLDP_LDFLAGS $sanitizers" AC_DEFINE([HAVE_ADDRESS_SANITIZER], 1, [Define if have both address and leak sanitizer]) +elif test x"$hardening" != x"no"; then + AX_LDFLAGS_OPTION([-fsanitize=safe-stack], [LLDP_BIN_LDFLAGS]) + if test x"$ax_cv_ld_check_flag__fsanitize_safe_stack" != x"no"; then + AX_CFLAGS_GCC_OPTION([-fsanitize=safe-stack], [LLDP_CFLAGS]) + fi fi ]) 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-0.9.9/edit.am new/lldpd-1.0.1/edit.am --- old/lldpd-0.9.9/edit.am 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/edit.am 2017-12-19 14:05:51.000000000 +0100 @@ -9,7 +9,6 @@ -e 's|@includedir[@]|$(includedir)|g' \ -e 's|@exec_prefix[@]|$(exec_prefix)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ - -e 's|@mkdir_p[@]|$(mkdir_p)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' \ -e 's|@PACKAGE[@]|$(PACKAGE)|g' \ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \ 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-0.9.9/m4/os.m4 new/lldpd-1.0.1/m4/os.m4 --- old/lldpd-0.9.9/m4/os.m4 2016-03-22 17:22:00.000000000 +0100 +++ new/lldpd-1.0.1/m4/os.m4 2017-11-21 17:37:43.000000000 +0100 @@ -22,7 +22,7 @@ lldp_DEFINE_OS(dragonfly*, [DragonFly BSD], DRAGONFLY) lldp_DEFINE_OS(openbsd*, OpenBSD, OPENBSD) lldp_DEFINE_OS(netbsd*, NetBSD, NETBSD) - lldp_DEFINE_OS(darwin*, [OS X], OSX) + lldp_DEFINE_OS(darwin*, macOS, OSX) lldp_DEFINE_OS(solaris*, Solaris, SOLARIS) if test x"$os" = x; then 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-0.9.9/src/client/conf-lldp.c new/lldpd-1.0.1/src/client/conf-lldp.c --- old/lldpd-0.9.9/src/client/conf-lldp.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/client/conf-lldp.c 2018-03-12 16:56:10.000000000 +0100 @@ -172,6 +172,26 @@ } static int +cmd_port_descr(struct lldpctl_conn_t *conn, struct writer *w, + struct cmd_env *env, void *arg) +{ + lldpctl_atom_t *port; + const char *name; + const char *descr = cmdenv_get(env, "port-descr"); + + log_debug("lldpctl", "lldp port-descr '%s'", descr); + + while ((port = cmd_iterate_on_ports(conn, env, &name))) { + if (descr && lldpctl_atom_set_str(port, lldpctl_k_port_descr, descr) == NULL) { + log_warnx("lldpctl", "unable to set LLDP Port Description for %s." + " %s", name, lldpctl_last_strerror(conn)); + } + } + + return 1; +} + +static int cmd_portid_type(struct lldpctl_conn_t *conn, struct writer *w, struct cmd_env *env, void *arg) { @@ -605,6 +625,17 @@ } commands_new( + commands_new( + commands_new(configure_lldp, + "portdescription", + "Port Description", + NULL, NULL, NULL), + NULL, "Port description", + NULL, cmd_store_env_value, "port-descr"), + NEWLINE, "Set port description", + NULL, cmd_port_descr, NULL); + + commands_new( commands_new(configure_lldp, "capabilities-advertisements", "Enable chassis capabilities advertisement", 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-0.9.9/src/client/conf-system.c new/lldpd-1.0.1/src/client/conf-system.c --- old/lldpd-0.9.9/src/client/conf-system.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/client/conf-system.c 2018-03-18 23:01:35.000000000 +0100 @@ -51,6 +51,34 @@ } static int +cmd_perm_iface_pattern(struct lldpctl_conn_t *conn, struct writer *w, + struct cmd_env *env, void *arg) +{ + log_debug("lldpctl", "set permanent iface pattern"); + + lldpctl_atom_t *config = lldpctl_get_configuration(conn); + if (config == NULL) { + log_warnx("lldpctl", "unable to get configuration from lldpd. %s", + lldpctl_last_strerror(conn)); + return 0; + } + + const char *value = cmdenv_get(env, "iface-pattern"); + if (lldpctl_atom_set_str(config, + lldpctl_k_config_perm_iface_pattern, + value) == NULL) { + log_warnx("lldpctl", "unable to set permanent iface pattern. %s", + lldpctl_last_strerror(conn)); + lldpctl_atom_dec_ref(config); + return 0; + } + log_info("lldpctl", "permanent iface pattern set to new value %s", + value?value:"(none)"); + lldpctl_atom_dec_ref(config); + return 1; +} + +static int cmd_iface_promisc(struct lldpctl_conn_t *conn, struct writer *w, struct cmd_env *env, void *arg) { @@ -110,6 +138,33 @@ } static int +cmd_system_chassisid(struct lldpctl_conn_t *conn, struct writer *w, + struct cmd_env *env, void *arg) +{ + const char *value; + value = cmdenv_get(env, "description"); + log_debug("lldpctl", "set chassis ID"); + lldpctl_atom_t *config = lldpctl_get_configuration(conn); + if (config == NULL) { + log_warnx("lldpctl", "unable to get configuration from lldpd. %s", + lldpctl_last_strerror(conn)); + return 0; + } + if (lldpctl_atom_set_str(config, + lldpctl_k_config_cid_string, + value) == NULL) { + log_warnx("lldpctl", "unable to set chassis ID. %s", + lldpctl_last_strerror(conn)); + lldpctl_atom_dec_ref(config); + return 0; + } + log_info("lldpctl", "chassis ID set to new value %s", + value?value:"(none)"); + lldpctl_atom_dec_ref(config); + return 1; +} + +static int cmd_management(struct lldpctl_conn_t *conn, struct writer *w, struct cmd_env *env, void *arg) { @@ -340,6 +395,22 @@ commands_new( commands_new( commands_new(configure_system, + "chassisid", "Override chassis ID", + NULL, NULL, NULL), + NULL, "Chassis ID", + NULL, cmd_store_env_value, "description"), + NEWLINE, "Override chassis ID", + NULL, cmd_system_chassisid, "system"); + commands_new( + commands_new(unconfigure_system, + "chassisid", "Don't override chassis ID", + NULL, NULL, NULL), + NEWLINE, "Don't override chassis ID", + NULL, cmd_system_chassisid, "system"); + + commands_new( + commands_new( + commands_new(configure_system, "platform", "Override platform description", NULL, NULL, NULL), NULL, "Platform description (CDP)", @@ -410,9 +481,25 @@ commands_new(unconfigure_interface, "pattern", "Delete any interface pattern", NULL, NULL, NULL), - NEWLINE, "Delete any interface pattern", + NEWLINE, "Clear interface pattern", NULL, cmd_iface_pattern, NULL); + commands_new( + commands_new( + commands_new(configure_interface, + "permanent", "Set permanent interface pattern", + NULL, NULL, NULL), + NULL, "Permanent interface pattern (comma-separated list of wildcards)", + NULL, cmd_store_env_value, "iface-pattern"), + NEWLINE, "Set permanent interface pattern", + NULL, cmd_perm_iface_pattern, NULL); + commands_new( + commands_new(unconfigure_interface, + "permanent", "Clear permanent interface pattern", + NULL, NULL, NULL), + NEWLINE, "Delete any interface pattern", + NULL, cmd_perm_iface_pattern, NULL); + commands_new( commands_new(configure_interface, "description", "Update interface descriptions with neighbor 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-0.9.9/src/client/display.c new/lldpd-1.0.1/src/client/display.c --- old/lldpd-0.9.9/src/client/display.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/client/display.c 2018-03-18 23:01:35.000000000 +0100 @@ -893,8 +893,12 @@ N(lldpctl_atom_get_str(configuration, lldpctl_k_config_mgmt_pattern))); tag_datatag(w, "iface-pattern", "Interface pattern", N(lldpctl_atom_get_str(configuration, lldpctl_k_config_iface_pattern))); + tag_datatag(w, "perm-iface-pattern", "Permanent interface pattern", + N(lldpctl_atom_get_str(configuration, lldpctl_k_config_perm_iface_pattern))); tag_datatag(w, "cid-pattern", "Interface pattern for chassis ID", N(lldpctl_atom_get_str(configuration, lldpctl_k_config_cid_pattern))); + tag_datatag(w, "cid-string", "Override chassis ID with", + N(lldpctl_atom_get_str(configuration, lldpctl_k_config_cid_string))); tag_datatag(w, "description", "Override description with", N(lldpctl_atom_get_str(configuration, lldpctl_k_config_description))); tag_datatag(w, "platform", "Override platform with", 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-0.9.9/src/client/lldpcli.8.in new/lldpd-1.0.1/src/client/lldpcli.8.in --- old/lldpd-0.9.9/src/client/lldpcli.8.in 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/client/lldpcli.8.in 2018-03-18 23:01:35.000000000 +0100 @@ -240,6 +240,20 @@ .Ed .Cd configure +.Cd system chassisid Ar description +.Bd -ragged -offset XXXXXX +Override chassis ID with the provided value instead of using MAC address +from one interface or host name. +.Ed + +.Cd unconfigure +.Cd system chassisid +.Bd -ragged -offset XXXXXX +Do not override chassis ID and use a value computed from one of the interface +MAC address (or host name if none is found). +.Ed + +.Cd configure .Cd system platform Ar description .Bd -ragged -offset XXXXXX Override platform description with the provided value instead of using @@ -294,6 +308,31 @@ .Ed .Cd configure +.Cd system interface permanent Ar pattern +.Bd -ragged -offset XXXXXX +Specify interfaces whose configuration is permanently kept by +.Nm lldpd . +By default, +.Nm lldpd +disregard any data about interfaces when they are removed from the +system (statistics, custom configuration). This option allows one to +specify a pattern similar to the interface pattern. If an interface +disappear but matches the pattern, its data is kept in memory and +reused if the interface reappear at some point. For example, on Linux, +one could use the pattern +.Em eth*,eno*,enp* , +which should match fixed interfaces on most systems. +.Ed + +.Cd unconfigure +.Cd system interface permanent +.Bd -ragged -offset XXXXXX +Remove any previously configured permanent interface pattern. Any +interface removed from the system will be forgotten. This option +undoes the previous one. +.Ed + +.Cd configure .Cd system interface description .Bd -ragged -offset XXXXXX Some OS allows the user to set a description for an interface. Setting @@ -425,7 +464,7 @@ .Cd configure .Op ports Ar ethX Op ,... .Cd lldp portidsubtype -.Cd local Ar value Op Cd description Ar description +.Cd local Ar value .Bd -ragged -offset XXXXXX Force port ID subtype. By default, .Nm lldpd @@ -440,8 +479,14 @@ or a local value (with .Cd value ) . In the latest case, the local value should be provided. -Optionally, a port description can also be provided after the local -value. +.Ed + +.Cd configure +.Op ports Ar ethX Op ,... +.Cd lldp portdescription +.Cd Ar description +.Bd -ragged -offset XXXXXX +Force port description to the provided string. .Ed .Cd configure 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-0.9.9/src/daemon/Makefile.am new/lldpd-1.0.1/src/daemon/Makefile.am --- old/lldpd-0.9.9/src/daemon/Makefile.am 2016-05-23 11:02:25.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/Makefile.am 2018-04-09 07:25:52.000000000 +0200 @@ -100,13 +100,6 @@ priv-bsd.c endif -# Add SNMP support if needed -if USE_SNMP -liblldpd_la_SOURCES += agent.c agent_priv.c agent.h -liblldpd_la_CFLAGS += @NETSNMP_CFLAGS@ -lldpd_LDADD += @NETSNMP_LIBS@ -endif - # seccomp support if USE_SECCOMP BUILT_SOURCES += syscall-names.h @@ -123,6 +116,16 @@ liblldpd_la_LIBADD += @SECCOMP_LIBS@ endif +# Add SNMP support if needed +if USE_SNMP +noinst_LTLIBRARIES += liblldpd-snmp.la +liblldpd_snmp_la_SOURCES = agent.c agent_priv.c agent.h +liblldpd_snmp_la_CFLAGS = $(liblldpd_la_CFLAGS) @NETSNMP_CFLAGS@ +liblldpd_snmp_la_CPPFLAGS = $(liblldpd_la_CPPFLAGS) +liblldpd_la_LIBADD += liblldpd-snmp.la +lldpd_LDADD += @NETSNMP_LIBS@ +endif + ## Systemtap/DTrace EXTRA_DIST = dtrace2systemtap.awk if ENABLE_SYSTEMTAP @@ -146,7 +149,7 @@ if LIBEVENT_EMBEDDED event.c: $(top_builddir)/libevent/libevent.la $(top_builddir)/libevent/libevent.la: $(top_srcdir)/libevent/*.c $(top_srcdir)/libevent/*.h - (cd $(top_builddir)/libevent && $(MAKE)) + (cd $(top_builddir)/libevent && $(MAKE) CFLAGS=-Wno-deprecated-declarations) endif ## systemd service file 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-0.9.9/src/daemon/agent.c new/lldpd-1.0.1/src/daemon/agent.c --- old/lldpd-0.9.9/src/daemon/agent.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/agent.c 2018-03-18 00:19:14.000000000 +0100 @@ -619,11 +619,16 @@ return (u_char *)&long_ret; case LLDP_SNMP_LASTUPDATE: long_ret = 0; - TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) - TAILQ_FOREACH(port, &hardware->h_rports, p_entries) { - if (SMART_HIDDEN(port)) continue; - if (port->p_lastchange > long_ret) - long_ret = port->p_lastchange; + TAILQ_FOREACH(hardware, &scfg->g_hardware, h_entries) { + /* Check if the last removal of a remote port on this local port was the last change. */ + if (hardware->h_lport.p_lastremove > long_ret) + long_ret = hardware->h_lport.p_lastremove; + /* Check if any change on the existing remote ports was the last change. */ + TAILQ_FOREACH(port, &hardware->h_rports, p_entries) { + if (SMART_HIDDEN(port)) continue; + if (port->p_lastchange > long_ret) + long_ret = port->p_lastchange; + } } if (long_ret) long_ret = (long_ret - starttime.tv_sec) * 100; 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-0.9.9/src/daemon/client.c new/lldpd-1.0.1/src/daemon/client.c --- old/lldpd-0.9.9/src/daemon/client.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/client.c 2018-03-18 23:01:35.000000000 +0100 @@ -71,7 +71,6 @@ if (CHANGED(c_tx_interval) && config->c_tx_interval != 0) { if (config->c_tx_interval < 0) { log_debug("rpc", "client asked for immediate retransmission"); - levent_send_now(cfg); } else { log_debug("rpc", "client change transmit interval to %d", config->c_tx_interval); @@ -79,6 +78,7 @@ cfg->g_config.c_ttl = cfg->g_config.c_tx_interval * cfg->g_config.c_tx_hold; } + levent_send_now(cfg); } if (CHANGED(c_tx_hold) && config->c_tx_hold > 0) { log_debug("rpc", "client change transmit hold to %d", @@ -130,6 +130,13 @@ cfg->g_config.c_iface_pattern = xstrdup(config->c_iface_pattern); levent_update_now(cfg); } + if (CHANGED_STR(c_perm_ifaces)) { + log_debug("rpc", "change permanent interface pattern to %s", + config->c_perm_ifaces?config->c_perm_ifaces:"(NULL)"); + free(cfg->g_config.c_perm_ifaces); + cfg->g_config.c_perm_ifaces = xstrdup(config->c_perm_ifaces); + levent_update_now(cfg); + } if (CHANGED_STR(c_mgmt_pattern)) { log_debug("rpc", "change management pattern to %s", config->c_mgmt_pattern?config->c_mgmt_pattern:"(NULL)"); @@ -137,11 +144,22 @@ cfg->g_config.c_mgmt_pattern = xstrdup(config->c_mgmt_pattern); levent_update_now(cfg); } + if (CHANGED_STR(c_cid_string)) { + log_debug("rpc", "change chassis ID string to %s", + config->c_cid_string?config->c_cid_string:"(NULL)"); + free(cfg->g_config.c_cid_string); + cfg->g_config.c_cid_string = xstrdup(config->c_cid_string); + free(LOCAL_CHASSIS(cfg)->c_id); + LOCAL_CHASSIS(cfg)->c_id = NULL; + lldpd_update_localchassis(cfg); + levent_update_now(cfg); + } if (CHANGED_STR(c_description)) { log_debug("rpc", "change chassis description to %s", config->c_description?config->c_description:"(NULL)"); free(cfg->g_config.c_description); cfg->g_config.c_description = xstrdup(config->c_description); + lldpd_update_localchassis(cfg); levent_update_now(cfg); } if (CHANGED_STR(c_platform)) { @@ -149,6 +167,7 @@ config->c_platform?config->c_platform:"(NULL)"); free(cfg->g_config.c_platform); cfg->g_config.c_platform = xstrdup(config->c_platform); + lldpd_update_localchassis(cfg); levent_update_now(cfg); } if (CHANGED_STR(c_hostname)) { @@ -156,6 +175,7 @@ config->c_hostname?config->c_hostname:"(NULL)"); free(cfg->g_config.c_hostname); cfg->g_config.c_hostname = xstrdup(config->c_hostname); + lldpd_update_localchassis(cfg); levent_update_now(cfg); } if (CHANGED(c_set_ifdescr)) { 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-0.9.9/src/daemon/interfaces-linux.c new/lldpd-1.0.1/src/daemon/interfaces-linux.c --- old/lldpd-0.9.9/src/daemon/interfaces-linux.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/interfaces-linux.c 2018-03-12 17:27:12.000000000 +0100 @@ -288,17 +288,15 @@ struct interfaces_device_list *interfaces, struct interfaces_device *iface) { + int ret = -1; struct ifreq ifr = {}; - union { - struct ethtool_perm_addr addr; - /* cppcheck-suppress unusedStructMember */ - char u8[sizeof(struct ethtool_perm_addr) + ETHER_ADDR_LEN]; - } epaddr; + struct ethtool_perm_addr *epaddr = calloc(sizeof(struct ethtool_perm_addr) + ETHER_ADDR_LEN, 1); + if (epaddr == NULL) goto end; strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); - epaddr.addr.cmd = ETHTOOL_GPERMADDR; - epaddr.addr.size = ETHER_ADDR_LEN; - ifr.ifr_data = (caddr_t)&epaddr.addr; + epaddr->cmd = ETHTOOL_GPERMADDR; + epaddr->size = ETHER_ADDR_LEN; + ifr.ifr_data = (caddr_t)epaddr; if (ioctl(cfg->g_sock, SIOCETHTOOL, &ifr) == -1) { static int once = 0; if (errno == EPERM && !once) { @@ -306,25 +304,27 @@ "no permission to get permanent MAC address for %s (requires 2.6.19+)", iface->name); once = 1; - return -1; + goto end; } if (errno != EPERM) - log_warnx("interfaces", "cannot get permanent MAC address for %s", + log_warn("interfaces", "cannot get permanent MAC address for %s", iface->name); - return -1; + goto end; } - if (epaddr.addr.data[0] != 0 || - epaddr.addr.data[1] != 0 || - epaddr.addr.data[2] != 0 || - epaddr.addr.data[3] != 0 || - epaddr.addr.data[4] != 0 || - epaddr.addr.data[5] != 0 || - epaddr.addr.data[6] != 0) { - memcpy(iface->address, epaddr.addr.data, ETHER_ADDR_LEN); - return 0; + if (epaddr->data[0] != 0 || + epaddr->data[1] != 0 || + epaddr->data[2] != 0 || + epaddr->data[3] != 0 || + epaddr->data[4] != 0 || + epaddr->data[5] != 0) { + memcpy(iface->address, epaddr->data, ETHER_ADDR_LEN); + ret = 0; + goto end; } - log_debug("interfaces", "cannot get permanent MAC for %s", iface->name); - return -1; + log_debug("interfaces", "cannot get permanent MAC for %s (all 0)", iface->name); + end: + free(epaddr); + return ret; } /** 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-0.9.9/src/daemon/lldpd.c new/lldpd-1.0.1/src/daemon/lldpd.c --- old/lldpd-0.9.9/src/daemon/lldpd.c 2017-11-21 07:18:19.000000000 +0100 +++ new/lldpd-1.0.1/src/daemon/lldpd.c 2018-03-18 23:01:35.000000000 +0100 @@ -40,6 +40,13 @@ #include <pwd.h> #include <grp.h> +#if HAVE_VFORK_H +# include <vfork.h> +#endif +#if HAVE_WORKING_FORK +# define vfork fork +#endif + static void usage(void); static struct protocol protos[] = @@ -91,10 +98,12 @@ fprintf(stderr, "-k Disable advertising of kernel release, version, machine.\n"); fprintf(stderr, "-S descr Override the default system description.\n"); fprintf(stderr, "-P name Override the default hardware platform.\n"); - fprintf(stderr, "-m IP Specify the IPv4 management addresses of this system.\n"); + fprintf(stderr, "-m IP Specify the IP management addresses of this system.\n"); fprintf(stderr, "-u file Specify the Unix-domain socket used for communication with lldpctl(8).\n"); fprintf(stderr, "-H mode Specify the behaviour when detecting multiple neighbors.\n"); fprintf(stderr, "-I iface Limit interfaces to use.\n"); + fprintf(stderr, "-C iface Limit interfaces to use for computing chassis ID.\n"); + fprintf(stderr, "-L path Override path for lldpcli command.\n"); fprintf(stderr, "-O file Override default configuration locations processed by lldpcli(8) at start.\n"); #ifdef ENABLE_LLDPMED fprintf(stderr, "-M class Enable emission of LLDP-MED frame. 'class' should be one of:\n"); @@ -105,6 +114,7 @@ #endif #ifdef USE_SNMP fprintf(stderr, "-x Enable SNMP subagent.\n"); + fprintf(stderr, "-X sock Specify the SNMP subagent socket.\n"); #endif fprintf(stderr, "\n"); @@ -135,9 +145,14 @@ { struct lldpd_hardware *hardware; TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) { - if ((strcmp(hardware->h_ifname, name) == 0) && - (hardware->h_ifindex == index)) - break; + if (strcmp(hardware->h_ifname, name) == 0) { + if (hardware->h_flags == 0) { + hardware->h_ifindex = index; + break; + } + if (hardware->h_ifindex == index) + break; + } } return hardware; } @@ -424,10 +439,24 @@ hardware = hardware_next) { hardware_next = TAILQ_NEXT(hardware, h_entries); if (!hardware->h_flags) { - TRACE(LLDPD_INTERFACES_DELETE(hardware->h_ifname)); - TAILQ_REMOVE(&cfg->g_hardware, hardware, h_entries); - lldpd_remote_cleanup(hardware, notify_clients_deletion, 1); - lldpd_hardware_cleanup(cfg, hardware); + int m = cfg->g_config.c_perm_ifaces? + pattern_match(hardware->h_ifname, cfg->g_config.c_perm_ifaces, 0): + 0; + switch (m) { + case 0: + log_debug("localchassis", "delete non-permanent interface %s", + hardware->h_ifname); + TRACE(LLDPD_INTERFACES_DELETE(hardware->h_ifname)); + TAILQ_REMOVE(&cfg->g_hardware, hardware, h_entries); + lldpd_remote_cleanup(hardware, notify_clients_deletion, 1); + lldpd_hardware_cleanup(cfg, hardware); + break; + case 1: + case 2: + log_debug("localchassis", "do not delete %s, permanent", + hardware->h_ifname); + break; + } } else { lldpd_remote_cleanup(hardware, notify_clients_deletion, !(hardware->h_flags & IFF_RUNNING)); @@ -964,7 +993,7 @@ if (!selected_port || port->p_lastupdate > selected_port->p_lastupdate) selected_port = port; } - if (selected_port->p_power.allocated != hardware->h_lport.p_power.allocated) { + if (selected_port && selected_port->p_power.allocated != hardware->h_lport.p_power.allocated) { log_info("receive", "for %s, PSE told us allocated is now %d instead of %d", hardware->h_ifname, selected_port->p_power.allocated, @@ -1128,7 +1157,7 @@ return routing; } -static void +void lldpd_update_localchassis(struct lldpd *cfg) { struct utsname un; @@ -1201,6 +1230,14 @@ has not been set previously (with the MAC address of an interface for example) */ + if (cfg->g_config.c_cid_string != NULL) { + log_debug("localchassis", "use specified chassis ID string"); + free(LOCAL_CHASSIS(cfg)->c_id); + if (!(LOCAL_CHASSIS(cfg)->c_id = strdup(cfg->g_config.c_cid_string))) + fatal("localchassis", NULL); + LOCAL_CHASSIS(cfg)->c_id_len = strlen(cfg->g_config.c_cid_string); + LOCAL_CHASSIS(cfg)->c_id_subtype = LLDP_CHASSISID_SUBTYPE_LOCAL; + } if (LOCAL_CHASSIS(cfg)->c_id == NULL) { log_debug("localchassis", "no chassis ID is currently set, use chassis name"); if (!(LOCAL_CHASSIS(cfg)->c_id = strdup(LOCAL_CHASSIS(cfg)->c_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-0.9.9/src/daemon/lldpd.h new/lldpd-1.0.1/src/daemon/lldpd.h --- old/lldpd-0.9.9/src/daemon/lldpd.h 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/lldpd.h 2017-12-31 22:58:23.000000000 +0100 @@ -37,13 +37,6 @@ #include <netinet/in.h> #include <sys/un.h> -#if HAVE_VFORK_H -# include <vfork.h> -#endif -#if HAVE_WORKING_FORK -# define vfork fork -#endif - #include "lldp-tlv.h" #if defined (ENABLE_CDP) || defined (ENABLE_FDP) # include "protocols/cdp.h" @@ -114,6 +107,7 @@ void lldpd_loop(struct lldpd *); int lldpd_main(int, char **, char **); void lldpd_update_localports(struct lldpd *); +void lldpd_update_localchassis(struct lldpd *); void lldpd_cleanup(struct lldpd *); /* frame.c */ 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-0.9.9/src/daemon/lldpd.service.in new/lldpd-1.0.1/src/daemon/lldpd.service.in --- old/lldpd-0.9.9/src/daemon/lldpd.service.in 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/lldpd.service.in 2018-04-09 13:39:42.000000000 +0200 @@ -9,7 +9,7 @@ NotifyAccess=main EnvironmentFile=-/etc/default/lldpd EnvironmentFile=-/etc/sysconfig/lldpd -ExecStartPre=@mkdir_p@ @PRIVSEP_CHROOT@ +ExecStartPre=/bin/mkdir -p @PRIVSEP_CHROOT@ ExecStart=@sbindir@/lldpd $DAEMON_ARGS $LLDPD_OPTIONS Restart=on-failure PrivateTmp=yes 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-0.9.9/src/daemon/netlink.c new/lldpd-1.0.1/src/daemon/netlink.c --- old/lldpd-0.9.9/src/daemon/netlink.c 2017-09-21 00:26:43.000000000 +0200 +++ new/lldpd-1.0.1/src/daemon/netlink.c 2018-03-01 09:53:19.000000000 +0100 @@ -606,7 +606,7 @@ TAILQ_FOREACH(ifaold, ifas, next) { if ((ifaold->index == ifanew->index) && !memcmp(&ifaold->address, &ifanew->address, - sizeof(ifaold->address))) continue; + sizeof(ifaold->address))) break; } if (getnameinfo((struct sockaddr *)&ifanew->address, sizeof(ifanew->address), 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-0.9.9/src/lib/atoms/config.c new/lldpd-1.0.1/src/lib/atoms/config.c --- old/lldpd-0.9.9/src/lib/atoms/config.c 2016-06-15 08:27:54.000000000 +0200 +++ new/lldpd-1.0.1/src/lib/atoms/config.c 2018-03-18 23:01:35.000000000 +0100 @@ -89,8 +89,12 @@ res = c->config->c_mgmt_pattern; break; case lldpctl_k_config_iface_pattern: res = c->config->c_iface_pattern; break; + case lldpctl_k_config_perm_iface_pattern: + res = c->config->c_perm_ifaces; break; case lldpctl_k_config_cid_pattern: res = c->config->c_cid_pattern; break; + case lldpctl_k_config_cid_string: + res = c->config->c_cid_string; break; case lldpctl_k_config_description: res = c->config->c_description; break; case lldpctl_k_config_platform: @@ -144,6 +148,12 @@ int rc; switch (key) { + case lldpctl_k_config_perm_iface_pattern: + if (!__lldpctl_atom_set_str_config(c, + &config.c_perm_ifaces, &c->config->c_perm_ifaces, + value)) + return NULL; + break; case lldpctl_k_config_iface_pattern: if (!__lldpctl_atom_set_str_config(c, &config.c_iface_pattern, &c->config->c_iface_pattern, @@ -156,6 +166,12 @@ value)) return NULL; break; + case lldpctl_k_config_cid_string: + if (!__lldpctl_atom_set_str_config(c, + &config.c_cid_string, &c->config->c_cid_string, + value)) + return NULL; + break; case lldpctl_k_config_description: if (!__lldpctl_atom_set_str_config(c, &config.c_description, &c->config->c_description, 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-0.9.9/src/lib/lldpctl.h new/lldpd-1.0.1/src/lib/lldpctl.h --- old/lldpd-0.9.9/src/lib/lldpctl.h 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/lib/lldpctl.h 2018-03-18 23:01:35.000000000 +0100 @@ -658,13 +658,15 @@ lldpctl_k_config_hostname, /**< `(S,WON)` System name overridden */ lldpctl_k_config_advertise_version, /**< `(I)` Advertise version */ lldpctl_k_config_lldpmed_noinventory, /**< `(I)` Disable LLDP-MED inventory */ - lldpctl_k_config_paused, /**< `(I)` lldpd is paused */ + lldpctl_k_config_paused, /**< `(I,WO)` lldpd is paused */ lldpctl_k_config_fast_start_enabled, /**< `(I,WO)` Is fast start enabled */ lldpctl_k_config_fast_start_interval, /**< `(I,WO)` Start fast transmit interval */ lldpctl_k_config_ifdescr_update, /**< `(I,WO)` Enable or disable setting interface description */ lldpctl_k_config_iface_promisc, /**< `(I,WO)` Enable or disable promiscuous mode on interfaces */ lldpctl_k_config_chassis_cap_advertise, /**< `(I,WO)` Enable or disable chassis capabilities advertisement */ lldpctl_k_config_chassis_mgmt_advertise, /**< `(I,WO)` Enable or disable management addresses advertisement */ + lldpctl_k_config_cid_string, /**< `(S,WON)` User defined string for the chassis ID */ + lldpctl_k_config_perm_iface_pattern, /**< `(S,WON)` Pattern of permanent interfaces */ lldpctl_k_interface_name = 1000, /**< `(S)` The interface 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-0.9.9/src/lldpd-structs.c new/lldpd-1.0.1/src/lldpd-structs.c --- old/lldpd-0.9.9/src/lldpd-structs.c 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/lldpd-structs.c 2018-03-18 23:01:35.000000000 +0100 @@ -176,7 +176,6 @@ if (!all && expire && (now >= port->p_lastupdate + port->p_ttl)) { hardware->h_ageout_cnt++; - hardware->h_delete_cnt++; del = 1; } if (del) { @@ -186,6 +185,10 @@ * real list. It is only needed to be called when we * don't delete the entire list. */ if (!all) TAILQ_REMOVE(&hardware->h_rports, port, p_entries); + + hardware->h_delete_cnt++; + /* Register last removal to be able to report lldpStatsRemTablesLastChangeTime */ + hardware->h_lport.p_lastremove = time(NULL); lldpd_port_cleanup(port, 1); free(port); } @@ -233,7 +236,9 @@ log_debug("alloc", "general configuration cleanup"); free(config->c_mgmt_pattern); free(config->c_cid_pattern); + free(config->c_cid_string); free(config->c_iface_pattern); + free(config->c_perm_ifaces); free(config->c_hostname); free(config->c_platform); free(config->c_description); 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-0.9.9/src/lldpd-structs.h new/lldpd-1.0.1/src/lldpd-structs.h --- old/lldpd-0.9.9/src/lldpd-structs.h 2017-09-15 07:18:22.000000000 +0200 +++ new/lldpd-1.0.1/src/lldpd-structs.h 2018-03-18 23:01:35.000000000 +0100 @@ -243,6 +243,8 @@ struct lldpd_chassis *p_chassis; /* Attached chassis */ time_t p_lastchange; /* Time of last change of values */ time_t p_lastupdate; /* Time of last update received */ + time_t p_lastremove; /* Time of last removal of a remote port. Used for local ports only + * Used for deciding lldpStatsRemTablesLastChangeTime */ struct lldpd_frame *p_lastframe; /* Frame received during last update */ u_int8_t p_protocol; /* Protocol used to get this port */ u_int8_t p_hidden_in:1; /* Considered as hidden for reception */ @@ -378,7 +380,9 @@ char *c_mgmt_pattern; /* Pattern to match a management address */ char *c_cid_pattern; /* Pattern to match interfaces to use for chassis ID */ + char *c_cid_string; /* User defined string for chassis ID */ char *c_iface_pattern; /* Pattern to match interfaces to use */ + char *c_perm_ifaces; /* Pattern to match interfaces to keep */ char *c_platform; /* Override platform description (for CDP) */ char *c_description; /* Override chassis description */ @@ -404,7 +408,9 @@ MARSHAL_BEGIN(lldpd_config) MARSHAL_STR(lldpd_config, c_mgmt_pattern) MARSHAL_STR(lldpd_config, c_cid_pattern) +MARSHAL_STR(lldpd_config, c_cid_string) MARSHAL_STR(lldpd_config, c_iface_pattern) +MARSHAL_STR(lldpd_config, c_perm_ifaces) MARSHAL_STR(lldpd_config, c_hostname) MARSHAL_STR(lldpd_config, c_platform) MARSHAL_STR(lldpd_config, c_description)
