Skip to content

Commit

Permalink
Updated pset_update_handler to update the active flag if it has changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadfisher committed Aug 12, 2010
1 parent f39b700 commit 0b8a992
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vrr_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int pset_remove(u_int node);
u_int pset_get_status(u_int node);
int pset_lookup_mac(mac_addr mac, u32 *node);
int pset_get_mac(u_int node, mac_addr mac);
int pset_get_status(u32 node);
int pset_get_active(u32 node);
int pset_update_status(u_int node, u_int new_status, u_int active);
int pset_inc_fail_count(struct pset_list *node);
int pset_reset_fail_count(u_int node);
Expand Down
5 changes: 4 additions & 1 deletion vrr_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,22 @@ void pset_update_handler(struct work_struct *work)
struct vrr_node *me = vrr_get_node();
int cur_state;
int next_state;
int cur_active;

list_for_each_safe(pos, q, &pset_updates.list) {
tmp = list_entry(pos, struct pset_update, list);
cur_state = pset_get_status(tmp->node);
next_state = hello_trans[cur_state][tmp->trans];
cur_active = pset_get_active(tmp->node);

VRR_DBG("%s[%s] ==> %s", pset_states[cur_state],
pset_trans[tmp->trans], pset_states[next_state]);

if (cur_state == PSET_UNKNOWN) {
pset_add(tmp->node, tmp->mac, next_state, tmp->active);
pset_state_update();
} else if (cur_state != next_state) {
} else if (cur_state != next_state ||
cur_active != tmp->active) {
pset_update_status(tmp->node, next_state, tmp->active);
pset_state_update();
}
Expand Down

0 comments on commit 0b8a992

Please sign in to comment.