--- embedaddon/quagga/ospf6d/ospf6_neighbor.c 2012/02/21 17:26:12 1.1.1.1 +++ embedaddon/quagga/ospf6d/ospf6_neighbor.c 2013/07/21 23:54:39 1.1.1.2 @@ -89,6 +89,7 @@ ospf6_neighbor_create (u_int32_t router_id, struct osp buf, oi->interface->name); on->ospf6_if = oi; on->state = OSPF6_NEIGHBOR_DOWN; + on->state_change = 0; quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed); on->router_id = router_id; @@ -154,6 +155,7 @@ ospf6_neighbor_state_change (u_char next_state, struct if (prev_state == next_state) return; + on->state_change++; quagga_gettime (QUAGGA_CLK_MONOTONIC, &on->last_changed); /* log */ @@ -180,6 +182,15 @@ ospf6_neighbor_state_change (u_char next_state, struct (next_state != OSPF6_NEIGHBOR_EXCHANGE && next_state != OSPF6_NEIGHBOR_LOADING)) ospf6_maxage_remove (on->ospf6_if->area->ospf6); + +#ifdef HAVE_SNMP + /* Terminal state or regression */ + if ((next_state == OSPF6_NEIGHBOR_FULL) || + (next_state == OSPF6_NEIGHBOR_TWOWAY) || + (next_state < prev_state)) + ospf6TrapNbrStateChange (on); +#endif + } /* RFC2328 section 10.4 */