Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libteam for openSUSE:Factory checked in at 2023-09-28 00:25:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libteam (Old) and /work/SRC/openSUSE:Factory/.libteam.new.23327 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libteam" Thu Sep 28 00:25:10 2023 rev:24 rq:1113705 version:1.32 Changes: -------- --- /work/SRC/openSUSE:Factory/libteam/libteam.changes 2023-06-27 23:17:06.539547795 +0200 +++ /work/SRC/openSUSE:Factory/.libteam.new.23327/libteam.changes 2023-09-28 00:37:39.899078567 +0200 @@ -1,0 +2,20 @@ +Tue Sep 26 14:47:59 UTC 2023 - Otto Hollmann <[email protected]> + +- update to 1.32: + * teamd: Add option to change evaluation logic of multiple + link-watchers + * teamd: lacp: don't move the port state from disabled when admin + state + * teamd: lacp: set port to disabled state during removal + * libteam: clear changed bits in case of TEAM_IFINFO_CHANGE + * teamd: stop iterating callbacks when a loop restart is + requested + * teamd: do no remove the ports on shutdown with -N + * binding/python: ifindex 0 is invalid so do not process it + * libteamdctl: validate the bus name before using it + * teamd: lacp: increase "min_ports" upper limit to 1024 + * teamd: increase the waitting time for daemon killing + * Do regard current state when considering port enablement +- Remove 0001-teamd-Add-option-to-change-evaluation-logic-of-multi.patch + +------------------------------------------------------------------- Old: ---- 0001-teamd-Add-option-to-change-evaluation-logic-of-multi.patch libteam-1.31.tar.gz New: ---- libteam-1.32.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libteam.spec ++++++ --- /var/tmp/diff_new_pack.sACMxA/_old 2023-09-28 00:37:41.363131824 +0200 +++ /var/tmp/diff_new_pack.sACMxA/_new 2023-09-28 00:37:41.363131824 +0200 @@ -20,7 +20,7 @@ # _tmpfilesdir is not defined in systemd macros up to openSUSE 13.2 %{!?_tmpfilesdir: %global _tmpfilesdir %{_libexecdir}/tmpfiles.d } Name: libteam -Version: 1.31 +Version: 1.32 Release: 0 Summary: Utilities for controlling 802.1AX team network device License: LGPL-2.1-or-later @@ -35,8 +35,6 @@ Patch4: 0001-allow-send_interface-dbus.patch Patch5: [email protected] Patch6: better_handle_failures_to_chown.patch -# PATCH-FIX-UPSTREAM jsc#PED-2209 Add option to change link-watchers logic -Patch7: 0001-teamd-Add-option-to-change-evaluation-logic-of-multi.patch BuildRequires: doxygen BuildRequires: libcap-devel BuildRequires: libtool ++++++ libteam-1.31.tar.gz -> libteam-1.32.tar.gz ++++++ ++++ 19190 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/libteam-1.31/binding/python/team/core.py new/libteam-1.32/binding/python/team/core.py --- old/libteam-1.31/binding/python/team/core.py 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/binding/python/team/core.py 2022-09-29 14:16:26.000000000 +0200 @@ -101,7 +101,8 @@ @ifindex.setter def ifindex(self, ifindex): self._ifindex = ifindex - self.ifname = self._conv.dev_ifname(ifindex) + if self.ifindex: + self.ifname = self._conv.dev_ifname(ifindex) def get_hwaddr(self): err, hwaddr = capi.team_hwaddr_get(self._th, self.ifindex, 6) 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/libteam-1.31/build-aux/ar-lib new/libteam-1.32/build-aux/ar-lib --- old/libteam-1.31/build-aux/ar-lib 2020-07-26 11:58:50.000000000 +0200 +++ new/libteam-1.32/build-aux/ar-lib 2022-09-29 14:17:54.000000000 +0200 @@ -2,9 +2,9 @@ # Wrapper for Microsoft lib.exe me=ar-lib -scriptversion=2012-03-01.08; # UTC +scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2018 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -65,7 +65,7 @@ mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin) + cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) @@ -224,10 +224,11 @@ esac done else - $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member - do - $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? - done + $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \ + | while read member + do + $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? + done fi elif test -n "$quick$replace"; 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/libteam-1.31/build-aux/compile new/libteam-1.32/build-aux/compile --- old/libteam-1.31/build-aux/compile 2020-07-26 11:58:50.000000000 +0200 +++ new/libteam-1.32/build-aux/compile 2022-09-29 14:17:54.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) 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/libteam-1.31/build-aux/missing new/libteam-1.32/build-aux/missing --- old/libteam-1.31/build-aux/missing 2020-07-26 11:58:50.000000000 +0200 +++ new/libteam-1.32/build-aux/missing 2022-09-29 14:17:54.000000000 +0200 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 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/libteam-1.31/config.h.in new/libteam-1.32/config.h.in --- old/libteam-1.31/config.h.in 2020-07-26 11:58:50.000000000 +0200 +++ new/libteam-1.32/config.h.in 2023-09-05 16:30:21.000000000 +0200 @@ -25,9 +25,6 @@ to 0 otherwise. */ #undef HAVE_MALLOC -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have rtnl_link_get_carrier. */ #undef HAVE_RTNL_LINK_GET_CARRIER @@ -40,6 +37,9 @@ /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H @@ -82,7 +82,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* TEAMD GROUP. */ 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/libteam-1.31/configure.ac new/libteam-1.32/configure.ac --- old/libteam-1.31/configure.ac 2020-07-26 11:56:44.000000000 +0200 +++ new/libteam-1.32/configure.ac 2023-09-05 16:29:02.000000000 +0200 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([libteam], [1.31], [[email protected]]) +AC_INIT([libteam], [1.32], [[email protected]]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) @@ -24,11 +24,11 @@ # release, then set age to 0. AC_SUBST(LIBTEAM_CURRENT, 11) -AC_SUBST(LIBTEAM_REVISION, 1) +AC_SUBST(LIBTEAM_REVISION, 2) AC_SUBST(LIBTEAM_AGE, 6) AC_SUBST(LIBTEAMDCTL_CURRENT, 1) -AC_SUBST(LIBTEAMDCTL_REVISION, 5) +AC_SUBST(LIBTEAMDCTL_REVISION, 6) AC_SUBST(LIBTEAMDCTL_AGE, 1) CFLAGS="$CFLAGS -Wall" 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/libteam-1.31/include/private/misc.h new/libteam-1.32/include/private/misc.h --- old/libteam-1.31/include/private/misc.h 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/include/private/misc.h 2022-11-24 15:48:33.000000000 +0100 @@ -90,7 +90,7 @@ if (sock == -1) return -errno; memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); + strncpy(ifr.ifr_name, ifname, IFNAMSIZ); ret = ioctl(sock, SIOCGIFINDEX, &ifr); close(sock); if (ret == -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/libteam-1.31/libteam/libteam.c new/libteam-1.32/libteam/libteam.c --- old/libteam-1.31/libteam/libteam.c 2020-04-25 08:05:38.000000000 +0200 +++ new/libteam-1.32/libteam/libteam.c 2022-12-01 13:35:47.000000000 +0100 @@ -236,7 +236,7 @@ break; } } - if (call_type_mask & TEAM_IFINFO_REFRESH) { + if (call_type_mask & (TEAM_IFINFO_REFRESH | TEAM_IFINFO_CHANGE)) { ifinfo_destroy_removed(th); ifinfo_clear_changed(th); } 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/libteam-1.31/libteam/options.c new/libteam-1.32/libteam/options.c --- old/libteam-1.31/libteam/options.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/libteam/options.c 2022-06-27 17:50:14.000000000 +0200 @@ -688,10 +688,10 @@ err = update_option(th, &option, opt_id, opt_type, data, data_len, true, true); - if (option->temporary) - destroy_option(option); if (err) return err; + if (option->temporary) + destroy_option(option); return 0; } 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/libteam-1.31/libteamdctl/cli_dbus.c new/libteam-1.32/libteamdctl/cli_dbus.c --- old/libteam-1.31/libteamdctl/cli_dbus.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/libteamdctl/cli_dbus.c 2022-06-27 17:50:14.000000000 +0200 @@ -183,12 +183,17 @@ if (ret == -1) return -errno; + err = -EINVAL; dbus_error_init(&error); + if (!dbus_validate_bus_name(cli_dbus->service_name, &error)) { + err(tdc, "dbus: Could not validate bus name: %s - %s", + error.name, error.message); + goto free_service_name; + } cli_dbus->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error); if (!cli_dbus->conn) { err(tdc, "dbus: Could not acquire the system bus: %s - %s", error.name, error.message); - err = -EINVAL; goto free_service_name; } err = 0; 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/libteam-1.31/m4/libtool.m4 new/libteam-1.32/m4/libtool.m4 --- old/libteam-1.31/m4/libtool.m4 2020-07-26 11:58:45.000000000 +0200 +++ new/libteam-1.32/m4/libtool.m4 2022-09-29 14:17:52.000000000 +0200 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1067,17 +1069,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1126,12 +1123,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1245,7 +1242,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1262,7 +1260,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1292,7 +1290,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1309,7 +1307,7 @@ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1321,7 +1319,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1343,7 +1341,7 @@ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1351,7 +1349,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1359,7 +1357,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1379,14 +1377,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1454,7 +1452,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1493,9 +1491,22 @@ m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1714,7 +1725,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1757,7 +1768,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2207,26 +2218,35 @@ striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2549,7 +2569,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2559,14 +2579,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2585,7 +2605,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2622,7 +2642,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2655,7 +2675,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3457,7 +3477,7 @@ bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3491,14 +3511,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3512,7 +3532,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3559,7 +3579,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3686,13 +3706,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3718,7 +3738,7 @@ # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3958,7 +3978,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3976,20 +3996,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4013,7 +4033,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4031,9 +4051,9 @@ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4320,7 +4340,7 @@ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4403,7 +4423,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4739,7 +4759,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4922,7 +4942,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4930,7 +4950,7 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4987,15 +5007,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5047,7 +5067,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5159,6 +5179,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5173,7 +5194,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5216,7 +5237,7 @@ _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5228,7 +5249,7 @@ if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5244,7 +5265,7 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5376,7 +5397,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5559,12 +5580,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5605,7 +5626,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5653,7 +5674,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5864,6 +5885,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6634,8 +6656,8 @@ cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6733,6 +6755,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6763,7 +6786,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6900,7 +6923,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7040,13 +7063,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8192,6 +8215,14 @@ AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates 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/libteam-1.31/m4/ltoptions.m4 new/libteam-1.32/m4/ltoptions.m4 --- old/libteam-1.31/m4/ltoptions.m4 2020-07-26 11:58:45.000000000 +0200 +++ new/libteam-1.32/m4/ltoptions.m4 2022-09-29 14:17:52.000000000 +0200 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives 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/libteam-1.31/m4/ltsugar.m4 new/libteam-1.32/m4/ltsugar.m4 --- old/libteam-1.31/m4/ltsugar.m4 2020-07-26 11:58:45.000000000 +0200 +++ new/libteam-1.32/m4/ltsugar.m4 2022-09-29 14:17:52.000000000 +0200 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # 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/libteam-1.31/m4/ltversion.m4 new/libteam-1.32/m4/ltversion.m4 --- old/libteam-1.31/m4/ltversion.m4 2020-07-26 11:58:45.000000000 +0200 +++ new/libteam-1.32/m4/ltversion.m4 2022-09-29 14:17:52.000000000 +0200 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) 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/libteam-1.31/m4/lt~obsolete.m4 new/libteam-1.32/m4/lt~obsolete.m4 --- old/libteam-1.31/m4/lt~obsolete.m4 2020-07-26 11:58:45.000000000 +0200 +++ new/libteam-1.32/m4/lt~obsolete.m4 2022-09-29 14:17:52.000000000 +0200 @@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives 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/libteam-1.31/man/teamd.conf.5 new/libteam-1.32/man/teamd.conf.5 --- old/libteam-1.31/man/teamd.conf.5 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/man/teamd.conf.5 2023-06-22 14:01:40.000000000 +0200 @@ -248,7 +248,7 @@ .RE .TP .BR "runner.min_ports " (int) -Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 255. +Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 1024. .RS 7 .PP Default: @@ -407,6 +407,23 @@ .TP .BR "link_watch.target_host "| " ports.PORTIFNAME.link_watch.target_host " (hostname) Hostname to be converted to IPv6 address which will be filled into NS packet as target address. +.TP +.BR "link_watch_policy " (string) +Name of link-watchers evaluation policy. Available options are following: +.RS 7 +.PP +.BR "any "\(em +Link is up if +.BR any +of the link-watchers reports the link up. +.PP +.BR "all "\(em +Link is up if +.BR all +of the link-watchers reports the link up. +.PP +Default: +.BR "any" .SH EXAMPLES .PP .nf @@ -519,6 +536,36 @@ .PP .nf { + "device": "team0", + "runner": {"name": "activebackup"}, + "link_watch_policy": "all", + "link_watch": [ + { + "name": "arp_ping", + "interval": 100, + "missed_max": 30, + "target_host": "192.168.23.1" + }, + { + "name": "ethtool" + } + ], + "ports": { + "eth1": { + "prio": -10, + "sticky": true + }, + "eth2": { + "prio": 100 + } + } +} +.fi +.PP +Two link-watchers are used at the same time. Link is up only if all configured link-watchers report link is up. +.PP +.nf +{ "device": "team0", "runner": { "name": "loadbalance", 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/libteam-1.31/teamd/example_configs/activebackup_multi_lw_2.conf new/libteam-1.32/teamd/example_configs/activebackup_multi_lw_2.conf --- old/libteam-1.31/teamd/example_configs/activebackup_multi_lw_2.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/libteam-1.32/teamd/example_configs/activebackup_multi_lw_2.conf 2023-06-22 14:01:40.000000000 +0200 @@ -0,0 +1,25 @@ +{ + "device": "team0", + "runner": {"name": "activebackup"}, + "link_watch_policy": "all", + "link_watch": [ + { + "name": "arp_ping", + "interval": 100, + "missed_max": 30, + "target_host": "192.168.23.1" + }, + { + "name": "ethtool" + } + ], + "ports": { + "eth1": { + "prio": -10, + "sticky": true + }, + "eth2": { + "prio": 100 + } + } +} \ No newline at end of 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/libteam-1.31/teamd/teamd.c new/libteam-1.32/teamd/teamd.c --- old/libteam-1.31/teamd/teamd.c 2020-05-22 17:01:28.000000000 +0200 +++ new/libteam-1.32/teamd/teamd.c 2023-06-22 14:01:40.000000000 +0200 @@ -309,16 +309,28 @@ } } +static int teamd_check_ctrl(struct teamd_context *ctx) +{ + int ctrl_fd = ctx->run_loop.ctrl_pipe_r; + struct timeval tv; + fd_set rfds; + + FD_ZERO(&rfds); + FD_SET(ctrl_fd, &rfds); + tv.tv_sec = tv.tv_usec = 0; + + return select(ctrl_fd + 1, &rfds, NULL, NULL, &tv); +} + static int teamd_run_loop_do_callbacks(struct list_item *lcb_list, fd_set *fds, struct teamd_context *ctx) { struct teamd_loop_callback *lcb; - struct teamd_loop_callback *tmp; int i; int events; int err; - list_for_each_node_entry_safe(lcb, tmp, lcb_list, list) { + list_for_each_node_entry(lcb, lcb_list, list) { for (i = 0; i < 3; i++) { if (!(lcb->fd_event & (1 << i))) continue; @@ -339,6 +351,16 @@ teamd_log_dbg(ctx, "Failed loop callback: %s, %p", lcb->name, lcb->priv); } + + /* + * If there's a control byte ready, it's possible that + * one or more entries have been removed from the + * callback list and restart has been requested. In any + * case, let the main loop deal with it first so that + * we know we're safe to proceed. + */ + if (teamd_check_ctrl(ctx)) + return 0; } } return 0; @@ -1783,6 +1805,28 @@ #endif +static int teamd_get_link_watch_policy(struct teamd_context *ctx) +{ + int err; + const char *link_watch_policy; + + err = teamd_config_string_get(ctx, &link_watch_policy, "$.link_watch_policy"); + if (!err) { + if (!strcmp(link_watch_policy, "all")) { + ctx->evaluate_all_watchers = true; + } else if (!strcmp(link_watch_policy, "any")) { + ctx->evaluate_all_watchers = false; + } else { + teamd_log_err("Unrecognized value for link_watch_policy."); + teamd_log_err("Only \"any\" or \"all\" are allowed but \"%s\" found in config.", link_watch_policy); + return -EINVAL; + } + } else { + teamd_log_dbg(ctx, "No link_watch_policy specified in config, using default value \"any\"."); + } + return 0; +} + int main(int argc, char **argv) { enum teamd_exit_code ret = TEAMD_EXIT_FAILURE; @@ -1841,6 +1885,10 @@ if (err) goto config_free; + err = teamd_get_link_watch_policy(ctx); + if (err) + goto config_free; + err = teamd_set_default_pid_file(ctx); if (err) goto config_free; @@ -1858,7 +1906,7 @@ break; case DAEMON_CMD_KILL: if (daemon_pid_file_is_running() > 0) { - err = daemon_pid_file_kill_wait(SIGTERM, 5); + err = daemon_pid_file_kill_wait(SIGTERM, 30); if (err) teamd_log_warn("Failed to kill daemon: %s", strerror(errno)); 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/libteam-1.31/teamd/teamd.h new/libteam-1.32/teamd/teamd.h --- old/libteam-1.31/teamd/teamd.h 2020-02-04 18:16:36.000000000 +0100 +++ new/libteam-1.32/teamd/teamd.h 2023-06-22 14:01:40.000000000 +0200 @@ -105,6 +105,7 @@ bool no_quit_destroy; bool init_no_ports; bool pre_add_ports; + bool evaluate_all_watchers; char * config_file; char * config_text; json_t * config_json; @@ -180,6 +181,8 @@ int (*admin_state_changed)(struct teamd_context *ctx, void *priv); int (*port_added)(struct teamd_context *ctx, struct teamd_port *tdport, void *priv); + void (*port_removing)(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv); void (*port_removed)(struct teamd_context *ctx, struct teamd_port *tdport, void *priv); int (*port_changed)(struct teamd_context *ctx, @@ -200,6 +203,8 @@ int teamd_event_port_added(struct teamd_context *ctx, struct teamd_port *tdport); +void teamd_event_port_removing(struct teamd_context *ctx, + struct teamd_port *tdport); void teamd_event_port_removed(struct teamd_context *ctx, struct teamd_port *tdport); int teamd_event_port_changed(struct teamd_context *ctx, 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/libteam-1.31/teamd/teamd_events.c new/libteam-1.32/teamd/teamd_events.c --- old/libteam-1.31/teamd/teamd_events.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/teamd/teamd_events.c 2022-12-07 13:45:03.000000000 +0100 @@ -50,6 +50,18 @@ return 0; } +void teamd_event_port_removing(struct teamd_context *ctx, + struct teamd_port *tdport) +{ + struct event_watch_item *watch; + + list_for_each_node_entry(watch, &ctx->event_watch_list, list) { + if (!watch->ops->port_removing) + continue; + watch->ops->port_removing(ctx, tdport, watch->priv); + } +} + void teamd_event_port_removed(struct teamd_context *ctx, struct teamd_port *tdport) { 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/libteam-1.31/teamd/teamd_link_watch.c new/libteam-1.32/teamd/teamd_link_watch.c --- old/libteam-1.31/teamd/teamd_link_watch.c 2020-02-04 18:16:36.000000000 +0100 +++ new/libteam-1.32/teamd/teamd_link_watch.c 2023-06-22 14:01:40.000000000 +0200 @@ -133,11 +133,28 @@ if (!tdport) return true; link = true; - teamd_for_each_port_priv_by_creator(common_ppriv, tdport, - LW_PORT_PRIV_CREATOR_PRIV) { - link = common_ppriv->link_up; - if (link) - return link; + if (ctx->evaluate_all_watchers) { + /* + * If multiple link-watchers used at the same time, + * link is up if ALL of the link-watchers reports the link up. + */ + teamd_for_each_port_priv_by_creator(common_ppriv, tdport, + LW_PORT_PRIV_CREATOR_PRIV) { + link = common_ppriv->link_up; + if (!link) + return link; + } + } else { + /* + * If multiple link-watchers used at the same time, + * link is up if ANY of the link-watchers reports the link up. + */ + teamd_for_each_port_priv_by_creator(common_ppriv, tdport, + LW_PORT_PRIV_CREATOR_PRIV) { + link = common_ppriv->link_up; + if (link) + return link; + } } return link; } 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/libteam-1.31/teamd/teamd_per_port.c new/libteam-1.32/teamd/teamd_per_port.c --- old/libteam-1.31/teamd/teamd_per_port.c 2020-02-04 18:16:36.000000000 +0100 +++ new/libteam-1.32/teamd/teamd_per_port.c 2022-12-07 13:45:03.000000000 +0100 @@ -217,7 +217,6 @@ struct teamd_port *tdport = _port(port_obj); teamd_event_port_removed(ctx, tdport); - teamd_port_remove(ctx, tdport); port_obj_destroy(ctx, port_obj); port_obj_free(port_obj); } @@ -352,6 +351,7 @@ teamd_log_dbg(ctx, "%s: Removing port (found ifindex \"%d\").", tdport->ifname, tdport->ifindex); + teamd_event_port_removing(ctx, tdport); err = team_port_remove(ctx->th, tdport->ifindex); if (err) teamd_log_err("%s: Failed to remove port.", tdport->ifname); @@ -442,14 +442,18 @@ bool should_enable, bool should_disable) { bool new_enabled_state; + bool curr_enabled_state; int err; if (!teamd_port_present(ctx, tdport)) return 0; + err = teamd_port_enabled(ctx, tdport, &curr_enabled_state); + if (err) + return err; - if (should_enable) + if (!curr_enabled_state && should_enable) new_enabled_state = true; - else if (should_disable) + else if (curr_enabled_state && should_disable) new_enabled_state = false; else return 0; 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/libteam-1.31/teamd/teamd_phys_port_check.c new/libteam-1.32/teamd/teamd_phys_port_check.c --- old/libteam-1.31/teamd/teamd_phys_port_check.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/teamd/teamd_phys_port_check.c 2022-09-27 10:45:54.000000000 +0200 @@ -19,6 +19,7 @@ #include <stdio.h> #include <errno.h> +#include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> 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/libteam-1.31/teamd/teamd_runner_lacp.c new/libteam-1.32/teamd/teamd_runner_lacp.c --- old/libteam-1.31/teamd/teamd_runner_lacp.c 2020-06-11 14:23:52.000000000 +0200 +++ new/libteam-1.32/teamd/teamd_runner_lacp.c 2023-02-03 15:16:05.000000000 +0100 @@ -23,9 +23,7 @@ #include <unistd.h> #include <limits.h> #include <sys/ioctl.h> -#include <linux/if_ether.h> #include <sys/socket.h> -#include <linux/netdevice.h> #include <netinet/in.h> #include <errno.h> #include <team.h> @@ -150,6 +148,7 @@ #define LACP_CFG_DFLT_FAST_RATE false int min_ports; #define LACP_CFG_DFLT_MIN_PORTS 1 +#define LACP_CFG_DFLT_MIN_PORTS_MAX 1024 enum lacp_agg_select_policy agg_select_policy; #define LACP_CFG_DFLT_AGG_SELECT_POLICY LACP_AGG_SELECT_LACP_PRIO } cfg; @@ -285,7 +284,7 @@ err = teamd_config_int_get(ctx, &tmp, "$.runner.min_ports"); if (err) { lacp->cfg.min_ports = LACP_CFG_DFLT_MIN_PORTS; - } else if (tmp < 1 || tmp > UCHAR_MAX) { + } else if (tmp < 1 || tmp > LACP_CFG_DFLT_MIN_PORTS_MAX) { teamd_log_err("\"min_ports\" value is out of its limits."); return -EINVAL; } else { @@ -949,9 +948,11 @@ static int lacp_port_set_state(struct lacp_port *lacp_port, enum lacp_port_state new_state) { + bool admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); int err; - if (new_state == lacp_port->state) + if (new_state == lacp_port->state || + (!admin_state && new_state != PORT_STATE_DISABLED)) return 0; if (new_state == PORT_STATE_DISABLED) lacp_port_periodic_off(lacp_port); @@ -1414,6 +1415,17 @@ return teamd_balancer_port_added(lacp->tb, tdport); } +static void lacp_event_watch_port_removing(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv) +{ + struct lacp *lacp = priv; + struct lacp_port *lacp_port = lacp_port_get(lacp, tdport); + + /* Ensure that no incoming LACPDU is going to be processed. */ + teamd_loop_callback_disable(ctx, LACP_SOCKET_CB_NAME, lacp_port); + lacp_port_set_state(lacp_port, PORT_STATE_DISABLED); +} + static void lacp_event_watch_port_removed(struct teamd_context *ctx, struct teamd_port *tdport, void *priv) { @@ -1435,6 +1447,7 @@ .hwaddr_changed = lacp_event_watch_hwaddr_changed, .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, .port_added = lacp_event_watch_port_added, + .port_removing = lacp_event_watch_port_removing, .port_removed = lacp_event_watch_port_removed, .port_changed = lacp_event_watch_port_changed, .admin_state_changed = lacp_event_watch_admin_state_changed, 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/libteam-1.31/teamd/teamd_runner_loadbalance.c new/libteam-1.32/teamd/teamd_runner_loadbalance.c --- old/libteam-1.31/teamd/teamd_runner_loadbalance.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/teamd/teamd_runner_loadbalance.c 2022-09-27 10:45:54.000000000 +0200 @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <string.h> #include <sys/socket.h> #include <linux/netdevice.h> #include <team.h> 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/libteam-1.31/utils/teamnl.c new/libteam-1.32/utils/teamnl.c --- old/libteam-1.31/utils/teamnl.c 2020-01-09 15:42:51.000000000 +0100 +++ new/libteam-1.32/utils/teamnl.c 2022-06-27 17:44:38.000000000 +0200 @@ -24,6 +24,7 @@ #include <getopt.h> #include <errno.h> #include <sys/signalfd.h> +#include <sys/select.h> #include <signal.h> #include <unistd.h> #include <team.h>
