From 199c9dfa9b4cdb32de9edb82aa672dbcd81eadd69db3a16a6db045ba7765d247 Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Wed, 22 Nov 2017 10:50:23 +0000 Subject: [PATCH 1/6] Accepting request 544370 from home:ndas:branches:network - 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. OBS-URL: https://build.opensuse.org/request/show/544370 OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=9 --- check_if_psr_ops_were_initialized.patch | 44 +++++++++++++++++++++++++ ignore_ebusy_for_team_hwaddr_set.patch | 14 ++++++++ libteam.changes | 16 +++++++++ libteam.spec | 38 ++++++++++++++++++++- start_teamd_from_usr_sbin.patch | 12 +++++++ 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 check_if_psr_ops_were_initialized.patch create mode 100644 ignore_ebusy_for_team_hwaddr_set.patch create mode 100644 start_teamd_from_usr_sbin.patch 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.changes b/libteam.changes index acd9e7e..fc048f8 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +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..1785a8c 100644 --- a/libteam.spec +++ b/libteam.spec @@ -39,9 +39,21 @@ BuildRequires: pkgconfig(libnl-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-cli-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-genl-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-route-3.0) >= 3.2.0 +BuildRequires: libcap-devel %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 + +# Some defines +# +%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,10 +121,16 @@ programs that will manipulate team network devices. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -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" @@ -133,15 +151,26 @@ 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 +%{_sbindir}/groupadd -r %teamd_group 2> /dev/null || : +%{_sbindir}/useradd -r -g %teamd_group -s /bin/false -c "Teamd daemon user" -d %{_localstatedir}/lib/empty %teamd_user 2> /dev/null || : +%{_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 +184,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 +213,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 From f8064cbc0eaaaf1bab0d12d124e404db2be6a4a909fd38b02627ab06fab6b84a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Nov 2017 10:55:02 +0000 Subject: [PATCH 2/6] - Do not suppress errors from useradd OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=10 --- libteam.changes | 5 +++++ libteam.spec | 32 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/libteam.changes b/libteam.changes index fc048f8..d4b8eb9 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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 diff --git a/libteam.spec b/libteam.spec index 1785a8c..78c9930 100644 --- a/libteam.spec +++ b/libteam.spec @@ -134,35 +134,37 @@ programs that will manipulate team network devices. # 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"; +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 -%{_sbindir}/groupadd -r %teamd_group 2> /dev/null || : -%{_sbindir}/useradd -r -g %teamd_group -s /bin/false -c "Teamd daemon user" -d %{_localstatedir}/lib/empty %teamd_user 2> /dev/null || : -%{_sbindir}/usermod -g %teamd_group %teamd_user 2>/dev/null || : +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 From 3279f7207db60fad2b297753a9a56efbd23da90b92582b00b478b8f1f6bcbc5c Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Nov 2017 10:56:03 +0000 Subject: [PATCH 3/6] run format_spec_file service OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=11 --- libteam.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libteam.spec b/libteam.spec index 78c9930..a698e6f 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 @@ -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 @@ -39,13 +40,12 @@ BuildRequires: pkgconfig(libnl-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-cli-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-genl-3.0) >= 3.2.0 BuildRequires: pkgconfig(libnl-route-3.0) >= 3.2.0 -BuildRequires: libcap-devel %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 +Patch0: check_if_psr_ops_were_initialized.patch +Patch1: start_teamd_from_usr_sbin.patch +Patch2: ignore_ebusy_for_team_hwaddr_set.patch # Some defines # From 774f5df09c328205e36bcd22b2148441731a163bead7b612863c335c177e5c27 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Nov 2017 10:56:20 +0000 Subject: [PATCH 4/6] drop redundant comment OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=12 --- libteam.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/libteam.spec b/libteam.spec index a698e6f..3061dd2 100644 --- a/libteam.spec +++ b/libteam.spec @@ -46,9 +46,6 @@ BuildRequires: systemd-rpm-macros Patch0: check_if_psr_ops_were_initialized.patch Patch1: start_teamd_from_usr_sbin.patch Patch2: ignore_ebusy_for_team_hwaddr_set.patch - -# Some defines -# %define teamd_user teamd %define teamd_group daemon %define teamd_daemon_directory /run/teamd From 8a216130505b48160c7aeb203b8e0a86ae118be768f96a52aced9300706d423d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Nov 2017 11:30:47 +0000 Subject: [PATCH 5/6] libteam-1.27 OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=13 --- libteam-1.26.tar.gz | 3 --- libteam-1.27.tar.gz | 3 +++ libteam.changes | 11 +++++++++++ libteam.spec | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) delete mode 100644 libteam-1.26.tar.gz create mode 100644 libteam-1.27.tar.gz 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 d4b8eb9..fa6a0a0 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +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 diff --git a/libteam.spec b/libteam.spec index 3061dd2..609f206 100644 --- a/libteam.spec +++ b/libteam.spec @@ -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+ From 49016750bc124c3b84ae07101569ec3a866965a0d30aa6d39c56ffd96ea03789 Mon Sep 17 00:00:00 2001 From: Nirmoy Das Date: Wed, 22 Nov 2017 16:31:37 +0000 Subject: [PATCH 6/6] Accepting request 544444 from home:ndas:branches:network - allow send_interface in dbus conf file for wicked. [+ 0001-allow-send_interface-dbus.patch] OBS-URL: https://build.opensuse.org/request/show/544444 OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=14 --- 0001-allow-send_interface-dbus.patch | 31 ++++++++++++++++++++++++++++ libteam.changes | 5 +++++ libteam.spec | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 0001-allow-send_interface-dbus.patch 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/libteam.changes b/libteam.changes index fa6a0a0..804386b 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +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 diff --git a/libteam.spec b/libteam.spec index 609f206..0e12549 100644 --- a/libteam.spec +++ b/libteam.spec @@ -46,6 +46,7 @@ BuildRequires: systemd-rpm-macros 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 @@ -121,6 +122,7 @@ programs that will manipulate team network devices. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %configure --includedir="%_includedir/pkg/%name" --bindir="%_sbindir" \