Skip to content

Commit

Permalink
Merge pull request #3 from mikajuvonen67/wmo/v1.31
Browse files Browse the repository at this point in the history
Wmo/v1.31
  • Loading branch information
mikajuvonen67 authored Jan 21, 2022
2 parents f732d37 + a32de35 commit 535faca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT([libteam], [1.31-wmo2], [[email protected]])
AC_INIT([libteam], [1.31-wmo3], [[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
Expand Down
16 changes: 8 additions & 8 deletions teamd/teamd_lw_ttdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,11 @@ static int lw_ttdp_load_options(struct teamd_context *ctx,
int err;
struct ab* ab = ctx->runner_priv;

if (ab == NULL) {
teamd_log_err("Configuration error");
return 1;
}

if (ab->is_s4r) {
if (ctx->runner && ctx->runner->name && (strncmp("ttdp_s4r", ctx->runner->name, 9) != 0)) {
teamd_log_err("This linkwatcher requires the \"ttdp_s4r\" runner. Aborting.");
Expand All @@ -726,11 +731,6 @@ static int lw_ttdp_load_options(struct teamd_context *ctx,
}
}

if (ab == NULL) {
teamd_log_err("Configuration error");
return 1;
}

err = teamd_config_int_get(ctx, &tmp, "@.initial_mode", cpcookie);
if (err) {
teamd_log_warn("Failed to get initial_mode, defaulting to 1 (slow)");
Expand Down Expand Up @@ -844,8 +844,8 @@ static int lw_ttdp_load_options(struct teamd_context *ctx,
err = teamd_config_int_get(ctx, &tmp, "@.direction", cpcookie);
if (err) {
struct ab* ab = ctx->runner_priv;
if (ab && (ab->direction == 1 || ab->direction == 2) ||
(ab->is_s4r && (ab->direction == 3 || ab->direction == 4))) {
if (ab && ((ab->direction == 1 || ab->direction == 2) ||
(ab->is_s4r && (ab->direction == 3 || ab->direction == 4)))) {
teamd_ttdp_log_infox(ttdp_ppriv, "Watcher direction not specified - using runner direction %d", ab->direction);
ttdp_ppriv->direction = ab->direction;
} else {
Expand Down Expand Up @@ -1679,7 +1679,7 @@ static int lw_ttdp_receive(struct teamd_context *ctx, int events, void *priv) {
notify = 1;
}

if (ab && ab->is_s4r && ttdp_ppriv->neighbor_primary_state != ttdp_ppriv->prev_neighbor_primary_state) {
if (ab->is_s4r && ttdp_ppriv->neighbor_primary_state != ttdp_ppriv->prev_neighbor_primary_state) {
teamd_ttdp_log_infox(ttdp_ppriv, "Neighbor has new primary state! %08X -> %08X",
ttdp_ppriv->prev_neighbor_primary_state, ttdp_ppriv->neighbor_primary_state);
struct ab *p = (struct ab*)ctx->runner_priv;
Expand Down
4 changes: 2 additions & 2 deletions teamd/teamd_runner_ttdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2878,14 +2878,14 @@ static int ab_init(struct teamd_context *ctx, void *priv)
{
struct ab *ab = priv;
ab->is_s4r = false;
_ab_init(ctx, priv);
return _ab_init(ctx, priv);
}

static int ab_init_s4r(struct teamd_context *ctx, void *priv)
{
struct ab *ab = priv;
ab->is_s4r = true;
_ab_init(ctx, priv);
return _ab_init(ctx, priv);
}

static void ab_fini(struct teamd_context *ctx, void *priv)
Expand Down

0 comments on commit 535faca

Please sign in to comment.