diff --git a/0001-allow-send_interface-dbus.patch b/0001-allow-send_interface-dbus.patch new file mode 100644 index 0000000..6b0107d --- /dev/null +++ b/0001-allow-send_interface-dbus.patch @@ -0,0 +1,31 @@ +From f0ebd1613f748f5ba4f873935d3e171cdeb8620c Mon Sep 17 00:00:00 2001 +From: Nirmoy Das +Date: Wed, 22 Nov 2017 16:49:53 +0100 +Subject: [PATCH] allow send_interface dbus + +--- + teamd/teamd.conf.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/teamd/teamd.conf.in b/teamd/teamd.conf.in +index 6ca3282..8fca859 100644 +--- a/teamd/teamd.conf.in ++++ b/teamd/teamd.conf.in +@@ -4,11 +4,14 @@ + + + ++ + + + ++ + + + ++ + + +-- +2.15.0 + diff --git a/check_if_psr_ops_were_initialized.patch b/check_if_psr_ops_were_initialized.patch new file mode 100644 index 0000000..68951bc --- /dev/null +++ b/check_if_psr_ops_were_initialized.patch @@ -0,0 +1,44 @@ +Index: libteam-1.16/teamd/teamd_lw_psr.c +=================================================================== +--- libteam-1.16.orig/teamd/teamd_lw_psr.c ++++ libteam-1.16/teamd/teamd_lw_psr.c +@@ -39,6 +39,9 @@ static int lw_psr_callback_periodic(stru + bool link_up = common_ppriv->link_up; + int err; + ++ if (!psr_ppriv->ops) ++ return -EINVAL; ++ + if (psr_ppriv->reply_received) { + link_up = true; + psr_ppriv->missed = 0; +@@ -65,6 +68,9 @@ static int lw_psr_callback_socket(struct + { + struct lw_psr_port_priv *psr_ppriv = priv; + ++ if (!psr_ppriv->ops) ++ return -EINVAL; ++ + return psr_ppriv->ops->receive(psr_ppriv); + } + +@@ -120,6 +126,9 @@ int lw_psr_port_added(struct teamd_conte + struct lw_psr_port_priv *psr_ppriv = priv; + int err; + ++ if (!psr_ppriv->ops) ++ return -EINVAL; ++ + err = lw_psr_load_options(ctx, tdport, psr_ppriv); + if (err) { + teamd_log_err("Failed to load options."); +@@ -182,6 +191,9 @@ void lw_psr_port_removed(struct teamd_co + { + struct lw_psr_port_priv *psr_ppriv = priv; + ++ if (!psr_ppriv->ops) ++ return; ++ + teamd_loop_callback_del(ctx, LW_PERIODIC_CB_NAME, psr_ppriv); + teamd_loop_callback_del(ctx, LW_SOCKET_CB_NAME, psr_ppriv); + psr_ppriv->ops->sock_close(psr_ppriv); diff --git a/ignore_ebusy_for_team_hwaddr_set.patch b/ignore_ebusy_for_team_hwaddr_set.patch new file mode 100644 index 0000000..ca15b9d --- /dev/null +++ b/ignore_ebusy_for_team_hwaddr_set.patch @@ -0,0 +1,14 @@ +Index: libteam-1.18/libteam/libteam.c +=================================================================== +--- libteam-1.18.orig/libteam/libteam.c ++++ libteam-1.18/libteam/libteam.c +@@ -1633,6 +1633,9 @@ int team_hwaddr_set(struct team_handle * + err = rtnl_link_change(th->nl_cli.sock, link, link, 0); + err = -nl2syserr(err); + ++ if (err == -EBUSY) ++ err = 0; ++ + nl_addr_put(nl_addr); + + errout: diff --git a/libteam-1.26.tar.gz b/libteam-1.26.tar.gz deleted file mode 100644 index 2efb31f..0000000 --- a/libteam-1.26.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ad5eae9e1a7835e784c5e21e8df323ca29ccc3ab8a8187fdc9ff3f6765c9b34 -size 564846 diff --git a/libteam-1.27.tar.gz b/libteam-1.27.tar.gz new file mode 100644 index 0000000..e82f622 --- /dev/null +++ b/libteam-1.27.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e74f8f5bba0511c7e971836794be7d88df4644e398dfb706c7679850cd44cdff +size 559534 diff --git a/libteam.changes b/libteam.changes index acd9e7e..804386b 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,3 +1,40 @@ +------------------------------------------------------------------- +Wed Nov 22 16:52:51 CET 2017 - ndas@suse.de + +- allow send_interface in dbus conf file for wicked. + [+ 0001-allow-send_interface-dbus.patch] +------------------------------------------------------------------- +Wed Nov 22 11:17:03 UTC 2017 - jengelh@inai.de + +- Update to new upstream release 1.27 + * teamd: escape some sensitive characters in ifname with + double quotation marks + * libteam: resynchronize ifinfo after lost RTNLGRP_LINK + notifications + * teamd: check port link_up when a port is added with + loadbalance runner + +------------------------------------------------------------------- +Wed Nov 22 10:54:50 UTC 2017 - jengelh@inai.de + +- Do not suppress errors from useradd + +------------------------------------------------------------------- +Wed Nov 22 11:26:44 CET 2017 - ndas@suse.de + +- sync with SLES changes(bsc#1055708) +* Add check_if_psr_ops_were_initialized.patch: +** Fix teamd segfault when link_watch initialization callbacks fail + (e.g. lw_psr_port_added() in case of activebackup runner) due to + an attempt to change hwaddr on an enslaved, link up port device. + Note: enslavement triggers initialization callbacks. +* Add ignore_ebusy_for_team_hwaddr_set.patch: +** Make PortAdd and PortRemove dbus methods work for all runners. + Ignore attempts to change hwaddr of an already enslaved devices. + (fate#318389,fate#317728,fate#316923) +- Add start_teamd_from_usr_sbin.patch: +* Modify service file to start teamd instance from /usr/sbin. + ------------------------------------------------------------------- Mon Nov 21 00:59:27 UTC 2016 - jengelh@inai.de diff --git a/libteam.spec b/libteam.spec index c4a2c4d..0e12549 100644 --- a/libteam.spec +++ b/libteam.spec @@ -1,7 +1,7 @@ # # spec file for package libteam # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libteam -Version: 1.26 +Version: 1.27 Release: 0 Summary: Utilities for controlling 802.1AX team network device License: LGPL-2.1+ @@ -29,6 +29,7 @@ Url: http://libteam.org/ Source: http://libteam.org/files/%name-%version.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: doxygen +BuildRequires: libcap-devel BuildRequires: pkg-config BuildRequires: python-devel BuildRequires: swig @@ -42,6 +43,15 @@ BuildRequires: pkgconfig(libnl-route-3.0) >= 3.2.0 %if 0%{?suse_version} >= 1220 BuildRequires: systemd-rpm-macros %endif +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 +%define teamd_user teamd +%define teamd_group daemon +%define teamd_daemon_directory /run/teamd +%define teamd_dbus_policy_directory %_sysconfdir/dbus-1/system.d +%define teamd_dbus_policy_name org.libteam.teamd.conf %description A library which is the user-space counterpart for the team network @@ -109,39 +119,59 @@ programs that will manipulate team network devices. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure --includedir="%_includedir/pkg/%name" --bindir="%_sbindir" \ - --disable-static + --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" -pushd binding/python/; -python ./setup.py build; -popd; +pushd binding/python/ +python ./setup.py build +popd %install -b="%buildroot"; -make install DESTDIR="$b"; -pushd binding/python/; -python ./setup.py install --root="$b" --prefix="%_prefix"; -popd; +b="%buildroot" +%make_install +pushd binding/python/ +python ./setup.py install --root="$b" --prefix="%_prefix" +popd rm -f "$b/%_libdir"/*.la %if 0%{?_unitdir:1} -mkdir -p "$b/%_unitdir"; -install -pm0644 teamd/redhat/systemd/*.service "$b/%_unitdir/"; +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 %pre tools +getent group daemon >/dev/null || %_sbindir/groupadd -r %teamd_group +getent passwd %teamd_user >/dev/null || \ + %_sbindir/useradd -r -g %teamd_group -s /bin/false \ + -c "Teamd daemon user" -d %{_localstatedir}/lib/empty %teamd_user +%_sbindir/usermod -g %teamd_group %teamd_user 2>/dev/null +test -L %teamd_daemon_directory || rm -rf %teamd_daemon_directory && : %if 0%{?_unitdir:1} %service_add_pre teamd@.service %endif %post tools +# reload dbus to apply new teamd's policy +/usr/bin/systemctl reload dbus.service 2>/dev/null || : %if 0%{?_unitdir:1} %service_add_post teamd@.service %endif @@ -155,6 +185,10 @@ make check %if 0%{?_unitdir:1} %service_del_postun teamd@.service %endif +# reload dbus to forget teamd's policy +if [ ${FIRST_ARG:-$1} -eq 0 ]; then + /usr/bin/systemctl reload dbus.service 2>/dev/null || : +fi %post -n libteam5 -p /sbin/ldconfig %postun -n libteam5 -p /sbin/ldconfig @@ -180,6 +214,9 @@ make check %defattr(-,root,root) %_sbindir/bond2team %_sbindir/team* +%dir %_sysconfdir/dbus-1 +%dir %teamd_dbus_policy_directory +%config %teamd_dbus_policy_directory/%teamd_dbus_policy_name %_mandir/man1/* %_mandir/man5/* %_mandir/man8/* diff --git a/start_teamd_from_usr_sbin.patch b/start_teamd_from_usr_sbin.patch new file mode 100644 index 0000000..7227726 --- /dev/null +++ b/start_teamd_from_usr_sbin.patch @@ -0,0 +1,12 @@ +Index: libteam-1.16/teamd/redhat/systemd/teamd@.service +=================================================================== +--- libteam-1.16.orig/teamd/redhat/systemd/teamd@.service ++++ libteam-1.16/teamd/redhat/systemd/teamd@.service +@@ -3,6 +3,6 @@ Description=Team Daemon for device %I + + [Service] + BusName=org.libteam.teamd.%i +-ExecStart=/usr/bin/teamd -U -D -o -t %i -f /run/teamd/%i.conf ++ExecStart=/usr/sbin/teamd -U -D -o -t %i -f /run/teamd/%i.conf + Restart=on-failure + RestartPreventExitStatus=1