libteam/check_if_psr_ops_were_initialized.patch
Nirmoy Das 199c9dfa9b 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
2017-11-22 10:50:23 +00:00

45 lines
1.2 KiB
Diff

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);