Hello community, here is the log from the commit of package libteam for openSUSE:Factory checked in at 2019-08-27 15:54:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libteam (Old) and /work/SRC/openSUSE:Factory/.libteam.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libteam" Tue Aug 27 15:54:01 2019 rev:19 rq:726118 version:1.29 Changes: -------- --- /work/SRC/openSUSE:Factory/libteam/libteam.changes 2019-02-28 21:37:39.585654219 +0100 +++ /work/SRC/openSUSE:Factory/.libteam.new.7948/libteam.changes 2019-08-27 15:54:01.307681740 +0200 @@ -1,0 +2,21 @@ +Mon Aug 26 09:02:37 UTC 2019 - Jan Engelhardt <[email protected]> + +- Update to upstream release 1.29 + * teamd: remove port if adding fails + * teamd: add a default value 1000 for link_watch.interval + * teamd: fix a json object memleak in get_port_obj() +- Update to upstream release 1.28 + * teamd: do not process lacpdu before the port ifinfo is set + * teamd: add port_hwaddr_changed for ab runner + * teamd: add port_hwaddr_changed for lb runner + * teamd: add port_hwaddr_changed for lacp runner + name + * libteam: don't crash when trying to print unregistered device + teamd_event_watch_ops + * teamd: add port_master_ifindex_changed for + syslog + * teamd: add an option to force log output to stdout, stderr or + DEFAULT to CURRENT + * teamd: lacp: send LACPDU when port state transitions from + +------------------------------------------------------------------- Old: ---- libteam-1.27.tar.gz New: ---- libteam-1.29.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libteam.spec ++++++ --- /var/tmp/diff_new_pack.R2lN3W/_old 2019-08-27 15:54:02.151681036 +0200 +++ /var/tmp/diff_new_pack.R2lN3W/_new 2019-08-27 15:54:02.155681033 +0200 @@ -18,22 +18,22 @@ %bcond_without python2 Name: libteam -Version: 1.27 +Version: 1.29 Release: 0 Summary: Utilities for controlling 802.1AX team network device License: LGPL-2.1+ Group: System/Kernel -Url: http://libteam.org/ +URL: http://libteam.org/ -#Git-Web: https://github.com/jpirko/libteam -#Git-Clone: git://github.com/jpirko/libteam +#Git-Clone: https://github.com/jpirko/libteam Source: http://libteam.org/files/%name-%version.tar.gz -Patch0: check_if_psr_ops_were_initialized.patch -Patch1: start_teamd_from_usr_sbin.patch -Patch2: ignore_ebusy_for_team_hwaddr_set.patch -Patch3: 0001-allow-send_interface-dbus.patch +Patch1: check_if_psr_ops_were_initialized.patch +Patch2: start_teamd_from_usr_sbin.patch +Patch3: ignore_ebusy_for_team_hwaddr_set.patch +Patch4: 0001-allow-send_interface-dbus.patch BuildRequires: doxygen BuildRequires: libcap-devel +BuildRequires: libtool BuildRequires: pkg-config BuildRequires: swig BuildRequires: pkgconfig(dbus-1) @@ -120,19 +120,13 @@ programs that will manipulate team network devices. %prep -%setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%autosetup -p1 %build %configure --includedir="%_includedir/%name" --bindir="%_sbindir" \ - --disable-silent-rules \ - --disable-static \ - --with-run-dir=%teamd_daemon_directory \ - --with-user=%teamd_user \ - --with-group=%teamd_group + --disable-silent-rules --disable-static \ + --with-run-dir="%teamd_daemon_directory" \ + --with-user="%teamd_user" --with-group=%teamd_group # Use CFLAGS= to kill -Werror make %{?_smp_mflags} CFLAGS="%optflags" %if %{with python2} @@ -155,11 +149,8 @@ mkdir -p "$b/%_unitdir" install -pm0644 teamd/redhat/systemd/*.service "$b/%_unitdir/" %endif - -%if 0%{?_sysconfdir:1} mkdir -p "$b/%teamd_dbus_policy_directory/" install -pm0644 teamd/dbus/teamd.conf "$b/%teamd_dbus_policy_directory/%teamd_dbus_policy_name" -%endif %check make check ++++++ libteam-1.27.tar.gz -> libteam-1.29.tar.gz ++++++ ++++ 5394 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.27/binding/python/team/capi.i new/libteam-1.29/binding/python/team/capi.i --- old/libteam-1.27/binding/python/team/capi.i 2017-06-05 15:41:00.000000000 +0200 +++ new/libteam-1.29/binding/python/team/capi.i 2019-07-02 15:42:33.000000000 +0200 @@ -40,7 +40,7 @@ if ($1) free($1); } %typemap(argout) (char *addr, unsigned int addr_len) { - $result = SWIG_Python_AppendOutput($result, PyString_FromStringAndSize($1,$2)); + $result = SWIG_Python_AppendOutput($result, SWIG_FromCharPtrAndSize($1,$2)); } %apply char *OUTPUT {char *addr}; int team_hwaddr_get(struct team_handle *th, uint32_t ifindex, char *addr, unsigned int addr_len); 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.27/binding/python/team/capi.i.in new/libteam-1.29/binding/python/team/capi.i.in --- old/libteam-1.27/binding/python/team/capi.i.in 2017-03-17 18:41:22.000000000 +0100 +++ new/libteam-1.29/binding/python/team/capi.i.in 2018-12-09 09:57:18.000000000 +0100 @@ -40,7 +40,7 @@ if ($1) free($1); } %typemap(argout) (char *addr, unsigned int addr_len) { - $result = SWIG_Python_AppendOutput($result, PyString_FromStringAndSize($1,$2)); + $result = SWIG_Python_AppendOutput($result, SWIG_FromCharPtrAndSize($1,$2)); } %apply char *OUTPUT {char *addr}; int team_hwaddr_get(struct team_handle *th, uint32_t ifindex, char *addr, unsigned int addr_len); 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.27/build-aux/ar-lib new/libteam-1.29/build-aux/ar-lib --- old/libteam-1.27/build-aux/ar-lib 2017-06-05 15:40:55.000000000 +0200 +++ new/libteam-1.29/build-aux/ar-lib 2019-04-17 09:38:47.000000000 +0200 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2018 Free Software Foundation, Inc. # Written by Peter Rosin <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a 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.27/build-aux/compile new/libteam-1.29/build-aux/compile --- old/libteam-1.27/build-aux/compile 2017-06-05 15:40:55.000000000 +0200 +++ new/libteam-1.29/build-aux/compile 2019-04-17 09:38:47.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libteam-1.27/build-aux/missing new/libteam-1.29/build-aux/missing --- old/libteam-1.27/build-aux/missing 2017-06-05 15:40:55.000000000 +0200 +++ new/libteam-1.29/build-aux/missing 2019-04-17 09:38:47.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 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 @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libteam-1.27/configure.ac new/libteam-1.29/configure.ac --- old/libteam-1.27/configure.ac 2017-06-05 11:32:43.000000000 +0200 +++ new/libteam-1.29/configure.ac 2019-07-02 15:41:37.000000000 +0200 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([libteam], [1.27], [[email protected]]) +AC_INIT([libteam], [1.29], [[email protected]]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) @@ -23,9 +23,9 @@ # 6. If any interfaces have been removed or changed since the last public # release, then set age to 0. -AC_SUBST(LIBTEAM_CURRENT, 9) +AC_SUBST(LIBTEAM_CURRENT, 11) AC_SUBST(LIBTEAM_REVISION, 0) -AC_SUBST(LIBTEAM_AGE, 4) +AC_SUBST(LIBTEAM_AGE, 6) AC_SUBST(LIBTEAMDCTL_CURRENT, 1) AC_SUBST(LIBTEAMDCTL_REVISION, 5) @@ -39,8 +39,10 @@ PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0 libnl-route-3.0 libnl-cli-3.0]) TMP_CFLAGS="$CFLAGS" + TMP_LDFLAGS="$LDFLAGS" TMP_LIBS="$LIBS" CFLAGS="$CPPFLAGS $LIBNL_CFLAGS" + LDFLAGS="" LIBS="$LIBS $LIBNL_LIBS" AC_CHECK_LIB([nl-route-3], [rtnl_link_get_phys_port_id], AC_DEFINE(HAVE_RTNL_LINK_GET_PHYS_ID, [1], [Define to 1 if you have rtnl_link_get_phys_port_id function.])) @@ -49,6 +51,7 @@ AC_CHECK_LIB([nl-route-3], [rtnl_link_get_carrier], AC_DEFINE(HAVE_RTNL_LINK_GET_CARRIER, [1], [Define to 1 if you have rtnl_link_get_carrier.])) CFLAGS="$TMP_CFLAGS" + LDFLAGS="$TMP_LDFLAGS" LIBS="$TMP_LIBS" PKG_CHECK_MODULES([LIBDAEMON], [libdaemon]) 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.27/examples/python/team_daemon.py new/libteam-1.29/examples/python/team_daemon.py --- old/libteam-1.27/examples/python/team_daemon.py 2017-03-17 18:41:22.000000000 +0100 +++ new/libteam-1.29/examples/python/team_daemon.py 2018-12-09 09:57:18.000000000 +0100 @@ -146,7 +146,7 @@ if port.linkup: if (not best or port.speed > best.speed or - (port.speed == best.speed and port.duplex > port.duplex)): + (port.speed == best.speed and port.duplex > best.duplex)): best = port if best: self._change_active_port(active, best) 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.27/include/team.h new/libteam-1.29/include/team.h --- old/libteam-1.27/include/team.h 2017-04-11 08:40:23.000000000 +0200 +++ new/libteam-1.29/include/team.h 2018-12-09 09:57:18.000000000 +0100 @@ -223,6 +223,7 @@ TEAM_PORT_CHANGE = 0x1, TEAM_OPTION_CHANGE = 0x2, TEAM_IFINFO_CHANGE = 0x4, + TEAM_IFINFO_REFRESH = 0x8, TEAM_ANY_CHANGE = TEAM_PORT_CHANGE | TEAM_OPTION_CHANGE | TEAM_IFINFO_CHANGE, 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.27/libteam/ifinfo.c new/libteam-1.29/libteam/ifinfo.c --- old/libteam-1.27/libteam/ifinfo.c 2017-03-17 18:41:22.000000000 +0100 +++ new/libteam-1.29/libteam/ifinfo.c 2018-12-09 09:57:18.000000000 +0100 @@ -258,6 +258,8 @@ uint32_t ifindex; int err; + ifinfo_destroy_removed(th); + link = (struct rtnl_link *) obj; ifindex = rtnl_link_get_ifindex(link); @@ -294,6 +296,8 @@ uint32_t ifindex; int err; + ifinfo_destroy_removed(th); + link = (struct rtnl_link *) obj; ifindex = rtnl_link_get_ifindex(link); @@ -412,7 +416,8 @@ } } - ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); + ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE | + TEAM_IFINFO_REFRESH); if (ret < 0) err(th, "get_ifinfo_list: check_call_change_handers failed"); 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/libteam-1.27/libteam/libteam.c new/libteam-1.29/libteam/libteam.c --- old/libteam-1.27/libteam/libteam.c 2017-04-11 08:40:23.000000000 +0200 +++ new/libteam-1.29/libteam/libteam.c 2019-05-28 14:36:18.000000000 +0200 @@ -236,7 +236,7 @@ break; } } - if (call_type_mask & TEAM_IFINFO_CHANGE) { + if (call_type_mask & TEAM_IFINFO_REFRESH) { ifinfo_destroy_removed(th); ifinfo_clear_changed(th); } @@ -551,9 +551,9 @@ /* \endcond */ /* libnl uses default 32k socket receive buffer size, - * whicn can get too small. Use 96k for all sockets. + * which can get too small. Use 192k for all sockets. */ -#define NETLINK_RCVBUF 98304 +#define NETLINK_RCVBUF 196608 /** * @param th libteam library context @@ -638,6 +638,7 @@ nl_socket_modify_cb(th->nl_cli.sock_event, NL_CB_VALID, NL_CB_CUSTOM, cli_event_handler, th); nl_cli_connect(th->nl_cli.sock_event, NETLINK_ROUTE); + nl_socket_set_nonblocking(th->nl_cli.sock_event); env = getenv("TEAM_EVENT_BUFSIZE"); if (env) { 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.27/libteam/options.c new/libteam-1.29/libteam/options.c --- old/libteam-1.27/libteam/options.c 2017-03-17 18:41:22.000000000 +0100 +++ new/libteam-1.29/libteam/options.c 2018-12-09 09:57:18.000000000 +0100 @@ -258,12 +258,13 @@ bool changed; int nla_type; int opt_type; - long tmp; - bool tmp_bool; void *data; int data_len = 0; int err; struct nlattr *data_attr; + unsigned int tmp_u32; + bool tmp_bool; + int tmp_s32; if (nla_parse_nested(option_attrs, TEAM_ATTR_OPTION_MAX, nl_option, NULL)) { @@ -304,8 +305,8 @@ switch (nla_type) { case NLA_U32: - tmp = (long) nla_get_u32(data_attr); - data = &tmp; + tmp_u32 = nla_get_u32(data_attr); + data = &tmp_u32; opt_type = TEAM_OPTION_TYPE_U32; break; case NLA_STRING: @@ -323,8 +324,8 @@ opt_type = TEAM_OPTION_TYPE_BOOL; break; case NLA_S32: - tmp = (long) nla_get_s32(data_attr); - data = &tmp; + tmp_s32 = nla_get_s32(data_attr); + data = &tmp_s32; opt_type = TEAM_OPTION_TYPE_S32; break; default: 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.27/libteam/stringify.c new/libteam-1.29/libteam/stringify.c --- old/libteam-1.27/libteam/stringify.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/libteam/stringify.c 2018-12-09 09:57:18.000000000 +0100 @@ -344,7 +344,8 @@ team_is_port_removed(port) ? "-" : team_is_port_changed(port) ? "*" : " ", ifindex, - team_get_ifinfo_ifname(ifinfo), + ifinfo ? team_get_ifinfo_ifname(ifinfo) : + "(removed)", team_is_port_link_up(port) ? "up": "down", team_get_port_speed(port), team_get_port_duplex(port) ? "FD" : "HD"); 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.27/man/teamd.8 new/libteam-1.29/man/teamd.8 --- old/libteam-1.27/man/teamd.8 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/man/teamd.8 2018-12-09 09:57:18.000000000 +0100 @@ -69,6 +69,9 @@ .B "\-g, \-\-debug" Turns on debugging messages. Repeating the option increases verbosity. .TP +.B "\-l, \-\-log-output" +Force teamd log output to stdout, stderr or syslog. +.TP .B "\-r, \-\-force-recreate" Force team device recreation in case it already exists. .TP 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.27/man/teamd.conf.5 new/libteam-1.29/man/teamd.conf.5 --- old/libteam-1.27/man/teamd.conf.5 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/man/teamd.conf.5 2019-05-02 08:42:05.000000000 +0200 @@ -31,6 +31,9 @@ .BR "roundrobin "\(em Simple runner which directs the team device to transmits packets in a round-robin fashion. .PP +.BR "random "\(em +Simple runner which directs the team device to transmits packets on a randomly selected port. +.PP .BR "activebackup "\(em Watches for link changes and selects active port to be used for data transfers. .PP @@ -229,7 +232,7 @@ .RS 7 .PP Default: -.BR "255" +.BR "65535" .RE .TP .BR "runner.min_ports " (int) @@ -237,7 +240,7 @@ .RS 7 .PP Default: -.BR "0" +.BR "1" .RE .TP .BR "runner.agg_select_policy " (string) @@ -269,6 +272,11 @@ .TP .BR "ports.PORTIFNAME.lacp_prio " (int) Port priority according to LACP standard. The lower number means higher priority. +.RS 7 +.PP +Default: +.BR "255" +.RE .TP .BR "ports.PORTIFNAME.lacp_key " (int) Port key according to LACP standard. It is only possible to aggregate ports with the same key. @@ -300,6 +308,11 @@ .TP .BR "link_watch.interval "| " ports.PORTIFNAME.link_watch.interval " (int) Value is a positive number in milliseconds. It is the interval between ARP requests being sent. +.RS 7 +.PP +Default: +.BR "1000" +.RE .TP .BR "link_watch.init_wait "| " ports.PORTIFNAME.link_watch.init_wait " (int) Value is a positive number in milliseconds. It is the delay between link watch initialization and the first ARP request being sent. @@ -344,8 +357,17 @@ .BR "false" .RE .TP +.BR "link_watch.vlanid "| " ports.PORTIFNAME.link_watch.vlanid " (int) +By default, ARP requests are sent without VLAN tags. This option causes outgoing ARP requests to be sent with the specified VLAN ID number. +.RS 7 +.PP +Default: +.BR "None" +.RE +.TP .BR "link_watch.send_always "| " ports.PORTIFNAME.link_watch.send_always " (bool) By default, ARP requests are sent on active ports only. This option allows sending even on inactive ports. +.RS 7 .PP Default: .BR "false" @@ -354,6 +376,11 @@ .TP .BR "link_watch.interval "| " ports.PORTIFNAME.link_watch.interval " (int) Value is a positive number in milliseconds. It is the interval between sending NS packets. +.RS 7 +.PP +Default: +.BR "1000" +.RE .TP .BR "link_watch.init_wait "| " ports.PORTIFNAME.link_watch.init_wait " (int) Value is a positive number in milliseconds. It is the delay between link watch initialization and the first NS packet being sent. 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.27/teamd/redhat/initscripts/network-scripts/ifup-Team new/libteam-1.29/teamd/redhat/initscripts/network-scripts/ifup-Team --- old/libteam-1.27/teamd/redhat/initscripts/network-scripts/ifup-Team 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/redhat/initscripts/network-scripts/ifup-Team 2019-07-02 12:03:34.000000000 +0200 @@ -36,7 +36,7 @@ if [ ! -x /usr/bin/teamd ]; then net_log $"Team support not available: teamd not found" exit 1 - fi + fi /usr/bin/teamd ${TEAMD_CMDLINE} -d -D -t ${DEVICE} -c "${TEAM_CONFIG}" -p /var/run/teamd-${DEVICE}.pid || exit 1 # Bring up all existing port devices now for device in $(LANG=C egrep -l "^[[:space:]]*TEAM_MASTER=\"?${DEVICE}\"?" /etc/sysconfig/network-scripts/ifcfg-*) ; do 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.27/teamd/teamd.c new/libteam-1.29/teamd/teamd.c --- old/libteam-1.27/teamd/teamd.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd.c 2018-12-09 09:57:18.000000000 +0100 @@ -107,6 +107,7 @@ " file will be ignored)\n" " -p --pid-file=FILE Use the specified PID file\n" " -g --debug Increase verbosity\n" + " -l --log-output Force teamd log output to stdout, stderr or syslog\n" " -r --force-recreate Force team device recreation in case it\n" " already exists\n" " -o --take-over Take over the device if it already exists\n" @@ -140,6 +141,7 @@ { "config", required_argument, NULL, 'c' }, { "pid-file", required_argument, NULL, 'p' }, { "debug", no_argument, NULL, 'g' }, + { "log-output", required_argument, NULL, 'l' }, { "force-recreate", no_argument, NULL, 'r' }, { "take-over", no_argument, NULL, 'o' }, { "no-quit-destroy", no_argument, NULL, 'N' }, @@ -152,7 +154,7 @@ { NULL, 0, NULL, 0 } }; - while ((opt = getopt_long(argc, argv, "hdkevf:c:p:groNt:nDZ:Uu", + while ((opt = getopt_long(argc, argv, "hdkevf:c:p:gl:roNt:nDZ:Uu", long_options, NULL)) >= 0) { switch(opt) { @@ -191,6 +193,10 @@ case 'g': ctx->debug++; break; + case 'l': + free(ctx->log_output); + ctx->log_output = strdup(optarg); + break; case 'r': ctx->force_recreate = true; break; @@ -1494,6 +1500,16 @@ /* Child */ } + ctx->log_output = ctx->log_output ? : getenv("TEAM_LOG_OUTPUT"); + if (ctx->log_output) { + if (strcmp(ctx->log_output, "stdout") == 0) + daemon_log_use = DAEMON_LOG_STDOUT; + else if (strcmp(ctx->log_output, "stderr") == 0) + daemon_log_use = DAEMON_LOG_STDERR; + else if (strcmp(ctx->log_output, "syslog") == 0) + daemon_log_use = DAEMON_LOG_SYSLOG; + } + if (daemon_close_all(-1) < 0) { teamd_log_err("Failed to close all file descriptors."); daemon_retval_send(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.27/teamd/teamd.h new/libteam-1.29/teamd/teamd.h --- old/libteam-1.27/teamd/teamd.h 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd.h 2018-12-09 09:57:18.000000000 +0100 @@ -99,6 +99,7 @@ enum teamd_command cmd; bool daemonize; unsigned int debug; + char * log_output; bool force_recreate; bool take_over; bool no_quit_destroy; @@ -189,6 +190,9 @@ struct teamd_port *tdport, void *priv); int (*port_ifname_changed)(struct teamd_context *ctx, struct teamd_port *tdport, void *priv); + int (*port_master_ifindex_changed)(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv); int (*option_changed)(struct teamd_context *ctx, struct team_option *option, void *priv); char *option_changed_match_name; @@ -208,6 +212,8 @@ struct team_ifinfo *ifinfo); int teamd_event_ifinfo_ifname_changed(struct teamd_context *ctx, struct team_ifinfo *ifinfo); +int teamd_event_ifinfo_master_ifindex_changed(struct teamd_context *ctx, + struct team_ifinfo *ifinfo); int teamd_event_ifinfo_admin_state_changed(struct teamd_context *ctx, struct team_ifinfo *ifinfo); int teamd_events_init(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.27/teamd/teamd_config.c new/libteam-1.29/teamd/teamd_config.c --- old/libteam-1.27/teamd/teamd_config.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_config.c 2019-07-02 15:15:25.000000000 +0200 @@ -84,7 +84,7 @@ ports_obj = json_object(); if (!ports_obj) return -ENOMEM; - err = json_object_set(config_json, "ports", ports_obj); + err = json_object_set_new(config_json, "ports", ports_obj); if (err) { json_decref(ports_obj); return -ENOMEM; @@ -95,7 +95,7 @@ port_obj = json_object(); if (!port_obj) return -ENOMEM; - err = json_object_set(ports_obj, port_name, port_obj); + err = json_object_set_new(ports_obj, port_name, port_obj); if (err) { json_decref(port_obj); return -ENOMEM; @@ -155,6 +155,33 @@ return err; } +static int teamd_config_port_set(struct teamd_context *ctx, const char *port_name, + json_t *port_obj) +{ + struct teamd_port *tdport; + json_t *config; + int tmp, err; + + tdport = teamd_get_port_by_ifname(ctx, port_name); + if (!tdport) + return 0; + + config = json_object_get(port_obj, "prio"); + if (!json_is_integer(config)) { + teamd_log_err("%s: Failed to get integer for \"priority\".", + tdport->ifname); + return -ENOENT; + } + + tmp = json_integer_value(config); + err = team_set_port_priority(ctx->th, tdport->ifindex, tmp); + if (err) + teamd_log_err("%s: Failed to update \"priority\" to kernel", + tdport->ifname); + + return err; +} + int teamd_config_port_update(struct teamd_context *ctx, const char *port_name, const char *json_port_cfg_str) { @@ -181,9 +208,14 @@ /* replace existing object content */ json_object_clear(port_obj); err = json_object_update(port_obj, port_new_obj); - if (err) + if (err) { teamd_log_err("%s: Failed to update existing config " "port object", port_name); + goto new_port_decref; + } + + err = teamd_config_port_set(ctx, port_name, port_new_obj); + new_port_decref: json_decref(port_new_obj); return err; 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.27/teamd/teamd_events.c new/libteam-1.29/teamd/teamd_events.c --- old/libteam-1.27/teamd/teamd_events.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_events.c 2018-12-09 09:57:18.000000000 +0100 @@ -167,6 +167,25 @@ return 0; } +int teamd_event_ifinfo_master_ifindex_changed(struct teamd_context *ctx, + struct team_ifinfo *ifinfo) +{ + struct event_watch_item *watch; + uint32_t ifindex = team_get_ifinfo_ifindex(ifinfo); + struct teamd_port *tdport = teamd_get_port(ctx, ifindex); + int err; + + list_for_each_node_entry(watch, &ctx->event_watch_list, list) { + if (watch->ops->port_master_ifindex_changed && tdport) { + err = watch->ops->port_master_ifindex_changed(ctx, tdport, + watch->priv); + if (err) + return err; + } + } + return 0; +} + int teamd_event_ifinfo_admin_state_changed(struct teamd_context *ctx, struct team_ifinfo *ifinfo) { 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.27/teamd/teamd_ifinfo_watch.c new/libteam-1.29/teamd/teamd_ifinfo_watch.c --- old/libteam-1.27/teamd/teamd_ifinfo_watch.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_ifinfo_watch.c 2018-12-09 09:57:18.000000000 +0100 @@ -59,6 +59,11 @@ if (err) return err; } + if (team_is_ifinfo_master_ifindex_changed(ifinfo)) { + err = teamd_event_ifinfo_master_ifindex_changed(ctx, ifinfo); + if (err) + return err; + } } 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.27/teamd/teamd_link_watch.c new/libteam-1.29/teamd/teamd_link_watch.c --- old/libteam-1.27/teamd/teamd_link_watch.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_link_watch.c 2019-07-02 12:09:40.000000000 +0200 @@ -450,10 +450,19 @@ return link_watch_refresh_forced_send(ctx); } + +static int link_watch_port_master_ifindex_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + return link_watch_refresh_forced_send(ctx); +} + static const struct teamd_event_watch_ops link_watch_port_watch_ops = { .port_added = link_watch_event_watch_port_added, .port_removed = link_watch_event_watch_port_removed, .port_link_changed = link_watch_event_watch_port_link_changed, + .port_master_ifindex_changed = link_watch_port_master_ifindex_changed, .option_changed = link_watch_enabled_option_changed, .option_changed_match_name = "enabled", }; 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.27/teamd/teamd_lw_arp_ping.c new/libteam-1.29/teamd/teamd_lw_arp_ping.c --- old/libteam-1.27/teamd/teamd_lw_arp_ping.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_lw_arp_ping.c 2019-01-14 19:07:41.000000000 +0100 @@ -336,7 +336,8 @@ if (ap.ah.ar_hrd != htons(ll_my.sll_hatype) || ap.ah.ar_pro != htons(ETH_P_IP) || ap.ah.ar_hln != ll_my.sll_halen || - ap.ah.ar_pln != 4) { + ap.ah.ar_pln != 4 || + ap.ah.ar_op != htons(ARPOP_REPLY)) { 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.27/teamd/teamd_lw_nsna_ping.c new/libteam-1.29/teamd/teamd_lw_nsna_ping.c --- old/libteam-1.27/teamd/teamd_lw_nsna_ping.c 2017-05-08 09:55:37.000000000 +0200 +++ new/libteam-1.29/teamd/teamd_lw_nsna_ping.c 2019-03-08 12:58:42.000000000 +0100 @@ -203,6 +203,9 @@ struct sockaddr_in6 sendto_addr; struct ns_packet nsp; + if (!(psr_ppriv->common.forced_send)) + return 0; + err = teamd_getsockname_hwaddr(psr_ppriv->sock, &ll_my, sizeof(nsp.hwaddr)); if (err) 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.27/teamd/teamd_lw_psr.c new/libteam-1.29/teamd/teamd_lw_psr.c --- old/libteam-1.27/teamd/teamd_lw_psr.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_lw_psr.c 2019-05-02 08:42:05.000000000 +0200 @@ -28,6 +28,7 @@ */ static const struct timespec lw_psr_default_init_wait = { 0, 1 }; +#define LW_PSR_DEFAULT_INTERVAL 1000 #define LW_PSR_DEFAULT_MISSED_MAX 3 #define LW_PERIODIC_CB_NAME "lw_periodic" @@ -77,9 +78,13 @@ int tmp; err = teamd_config_int_get(ctx, &tmp, "@.interval", cpcookie); - if (err) { - teamd_log_err("Failed to get \"interval\" link-watch option."); - return -EINVAL; + if (!err) { + if (tmp < 0) { + teamd_log_err("\"interval\" must not be negative number."); + return -EINVAL; + } + } else { + tmp = LW_PSR_DEFAULT_INTERVAL; } teamd_log_dbg("interval \"%d\".", tmp); ms_to_timespec(&psr_ppriv->interval, tmp); 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.27/teamd/teamd_per_port.c new/libteam-1.29/teamd/teamd_per_port.c --- old/libteam-1.27/teamd/teamd_per_port.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_per_port.c 2019-04-17 09:33:18.000000000 +0200 @@ -42,6 +42,8 @@ }; #define _port(port_obj) (&(port_obj)->port) +static int teamd_port_remove(struct teamd_context *ctx, + struct teamd_port *tdport); int teamd_port_priv_create_and_get(void **ppriv, struct teamd_port *tdport, const struct teamd_port_priv *pp, @@ -203,6 +205,7 @@ teamd_event_port_removed: teamd_event_port_removed(ctx, tdport); list_del: + teamd_port_remove(ctx, tdport); port_obj_destroy(ctx, port_obj); port_obj_free(port_obj); return err; @@ -214,6 +217,7 @@ 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); } 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.27/teamd/teamd_runner_activebackup.c new/libteam-1.29/teamd/teamd_runner_activebackup.c --- old/libteam-1.27/teamd/teamd_runner_activebackup.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_runner_activebackup.c 2018-12-09 09:57:18.000000000 +0100 @@ -39,6 +39,8 @@ const char *name; int (*hwaddr_changed)(struct teamd_context *ctx, struct ab *ab); + int (*port_hwaddr_changed)(struct teamd_context *ctx, struct ab *ab, + struct teamd_port *tdport); int (*port_added)(struct teamd_context *ctx, struct ab *ab, struct teamd_port *tdport); int (*active_set)(struct teamd_context *ctx, struct ab *ab, @@ -95,6 +97,26 @@ return 0; } +static int +ab_hwaddr_policy_same_all_port_hwaddr_changed(struct teamd_context *ctx, + struct ab *ab, + struct teamd_port *tdport) +{ + int err; + + if (!memcmp(team_get_ifinfo_hwaddr(tdport->team_ifinfo), + ctx->hwaddr, ctx->hwaddr_len)) + return 0; + + err = team_hwaddr_set(ctx->th, tdport->ifindex, ctx->hwaddr, + ctx->hwaddr_len); + if (err) + teamd_log_err("%s: Failed to set port hardware address.", + tdport->ifname); + + return err; +} + static int ab_hwaddr_policy_same_all_port_added(struct teamd_context *ctx, struct ab *ab, struct teamd_port *tdport) @@ -114,6 +136,7 @@ static const struct ab_hwaddr_policy ab_hwaddr_policy_same_all = { .name = "same_all", .hwaddr_changed = ab_hwaddr_policy_same_all_hwaddr_changed, + .port_hwaddr_changed = ab_hwaddr_policy_same_all_port_hwaddr_changed, .port_added = ab_hwaddr_policy_same_all_port_added, }; @@ -411,6 +434,21 @@ return 0; } +static int ab_event_watch_port_hwaddr_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + struct ab *ab = priv; + + if (!teamd_port_present(ctx, tdport)) + return 0; + + if (ab->hwaddr_policy->port_hwaddr_changed) + return ab->hwaddr_policy->port_hwaddr_changed(ctx, ab, tdport); + + return 0; +} + static int ab_port_load_config(struct teamd_context *ctx, struct ab_port *ab_port) { @@ -482,6 +520,13 @@ return ab_link_watch_handler(ctx, priv); } +static int ab_event_watch_port_master_ifindex_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + return ab_link_watch_handler(ctx, priv); +} + static int ab_event_watch_prio_option_changed(struct teamd_context *ctx, struct team_option *option, void *priv) @@ -491,8 +536,10 @@ static const struct teamd_event_watch_ops ab_event_watch_ops = { .hwaddr_changed = ab_event_watch_hwaddr_changed, + .port_hwaddr_changed = ab_event_watch_port_hwaddr_changed, .port_added = ab_event_watch_port_added, .port_link_changed = ab_event_watch_port_link_changed, + .port_master_ifindex_changed = ab_event_watch_port_master_ifindex_changed, .option_changed = ab_event_watch_prio_option_changed, .option_changed_match_name = "priority", }; 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.27/teamd/teamd_runner_lacp.c new/libteam-1.29/teamd/teamd_runner_lacp.c --- old/libteam-1.27/teamd/teamd_runner_lacp.c 2017-05-08 09:55:37.000000000 +0200 +++ new/libteam-1.29/teamd/teamd_runner_lacp.c 2019-03-08 13:00:19.000000000 +0100 @@ -333,7 +333,8 @@ struct lacp *lacp = lacp_port->lacp; if (lacp_port_selected(lacp_port) && - lacp_port->agg_lead == lacp->selected_agg_lead) + lacp_port->agg_lead == lacp->selected_agg_lead && + lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION) return true; return false; } @@ -343,7 +344,8 @@ struct lacp *lacp = lacp_port->lacp; if (!lacp_port_selected(lacp_port) || - lacp_port->agg_lead != lacp->selected_agg_lead) + lacp_port->agg_lead != lacp->selected_agg_lead || + !(lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION)) return true; return false; } @@ -914,9 +916,13 @@ if (lacp_port->lacp->cfg.fast_rate) state |= INFO_STATE_LACP_TIMEOUT; if (lacp_port_selected(lacp_port) && - lacp_port_agg_selected(lacp_port)) - state |= INFO_STATE_SYNCHRONIZATION | - INFO_STATE_COLLECTING | INFO_STATE_DISTRIBUTING; + lacp_port_agg_selected(lacp_port)) { + state |= INFO_STATE_SYNCHRONIZATION; + state &= ~(INFO_STATE_COLLECTING | INFO_STATE_DISTRIBUTING); + if (lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION) + state |= INFO_STATE_COLLECTING | + INFO_STATE_DISTRIBUTING; + } if (lacp_port->state == PORT_STATE_EXPIRED) state |= INFO_STATE_EXPIRED; if (lacp_port->state == PORT_STATE_DEFAULTED) @@ -965,7 +971,12 @@ case PORT_STATE_DEFAULTED: teamd_loop_callback_disable(lacp_port->ctx, LACP_TIMEOUT_CB_NAME, lacp_port); - /* fall through */ + memset(&lacp_port->partner, 0, sizeof(lacp_port->partner)); + lacp_port->partner.state |= INFO_STATE_LACP_TIMEOUT; + err = lacp_port_partner_update(lacp_port); + if (err) + return err; + break; case PORT_STATE_DISABLED: memset(&lacp_port->partner, 0, sizeof(lacp_port->partner)); err = lacp_port_partner_update(lacp_port); @@ -1075,6 +1086,9 @@ if (err <= 0) return err; + if (!teamd_port_present(lacp_port->ctx, lacp_port->tdport)) + return 0; + if (!lacpdu_check(&lacpdu)) { teamd_log_warn("malformed LACP PDU came."); return 0; @@ -1333,6 +1347,31 @@ return 0; } +static int lacp_event_watch_port_hwaddr_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + struct lacp_port *lacp_port; + struct lacp *lacp = priv; + int err; + + if (!teamd_port_present(ctx, tdport)) + return 0; + + if (!memcmp(team_get_ifinfo_hwaddr(tdport->team_ifinfo), + ctx->hwaddr, ctx->hwaddr_len)) + return 0; + + err = lacp_port_set_mac(ctx, tdport); + if (err) + return err; + + lacp_port = lacp_port_get(lacp, tdport); + lacp_port_actor_system_update(lacp_port); + + return 0; +} + static int lacp_event_watch_admin_state_changed(struct teamd_context *ctx, void *priv) { @@ -1386,6 +1425,7 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { .hwaddr_changed = lacp_event_watch_hwaddr_changed, + .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, .port_added = lacp_event_watch_port_added, .port_removed = lacp_event_watch_port_removed, .port_changed = lacp_event_watch_port_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.27/teamd/teamd_runner_loadbalance.c new/libteam-1.29/teamd/teamd_runner_loadbalance.c --- old/libteam-1.27/teamd/teamd_runner_loadbalance.c 2017-03-17 19:04:54.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_runner_loadbalance.c 2019-04-17 09:38:12.000000000 +0200 @@ -87,11 +87,49 @@ return 0; } +static int lb_event_watch_port_hwaddr_changed(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv) +{ + int err; + + if (!teamd_port_present(ctx, tdport)) + return 0; + + if (!memcmp(team_get_ifinfo_hwaddr(tdport->team_ifinfo), + ctx->hwaddr, ctx->hwaddr_len)) + return 0; + + err = team_hwaddr_set(ctx->th, tdport->ifindex, ctx->hwaddr, + ctx->hwaddr_len); + if (err) + teamd_log_err("%s: Failed to set port hardware address.", + tdport->ifname); + + return err; +} + +static int lb_event_watch_enabled_option_changed(struct teamd_context *ctx, + struct team_option *option, + void *priv) +{ + struct teamd_port *tdport; + + tdport = teamd_get_port(ctx, team_get_option_port_ifindex(option)); + if (!tdport) + return 0; + + return lb_event_watch_port_link_changed(ctx, tdport, priv); +} + static const struct teamd_event_watch_ops lb_port_watch_ops = { .hwaddr_changed = lb_event_watch_hwaddr_changed, + .port_hwaddr_changed = lb_event_watch_port_hwaddr_changed, .port_added = lb_event_watch_port_added, .port_removed = lb_event_watch_port_removed, .port_link_changed = lb_event_watch_port_link_changed, + .option_changed = lb_event_watch_enabled_option_changed, + .option_changed_match_name = "enabled", }; static int lb_init(struct teamd_context *ctx, void *priv) 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.27/teamd/teamd_state.c new/libteam-1.29/teamd/teamd_state.c --- old/libteam-1.27/teamd/teamd_state.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/teamd/teamd_state.c 2019-04-17 09:38:12.000000000 +0200 @@ -333,6 +333,7 @@ list_for_each_node_entry(item, &ctx->state_val_list, list) { /* item->subpath[0] == '.' */ if (!strcmp(item->subpath + 1, subpath) && + (!item->per_port || tdport) && (!item->tdport || item->tdport == tdport)) { *p_item = item; *p_tdport = 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.27/utils/bond2team new/libteam-1.29/utils/bond2team --- old/libteam-1.27/utils/bond2team 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/utils/bond2team 2018-12-09 09:57:18.000000000 +0100 @@ -623,7 +623,7 @@ team_ifcfg_deliver() { pr_dbg "${FUNCNAME} $*" - if [ ! to_stdout ]; then + if ! to_stdout; then return 0 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/libteam-1.27/utils/teamnl.c new/libteam-1.29/utils/teamnl.c --- old/libteam-1.27/utils/teamnl.c 2017-03-17 18:41:23.000000000 +0100 +++ new/libteam-1.29/utils/teamnl.c 2019-01-14 19:07:41.000000000 +0100 @@ -521,7 +521,9 @@ printf( "%s [options] teamdevname command [command args]\n" - "\t-h --help Show this help\n", + "\t-h --help Show this help\n" + "\t-p --port_name team slave port name\n" + "\t-a --array_index team option array index\n", argv0); printf("Commands:\n"); for (i = 0; i < CMD_TYPE_COUNT; i++) {
