diff options
| -rw-r--r-- | isisd/isis_nb_config.c | 7 | ||||
| -rw-r--r-- | ospfd/ospf_snmp.c | 33 |
2 files changed, 20 insertions, 20 deletions
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index d5f4c605c4..24228ed701 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -2075,7 +2075,6 @@ int lib_interface_isis_area_tag_modify(struct nb_cb_modify_args *args) struct interface *ifp; struct vrf *vrf; const char *area_tag, *ifname, *vrfname; - struct isis *isis = NULL; if (args->event == NB_EV_VALIDATE) { /* libyang doesn't like relative paths across module boundaries @@ -2091,11 +2090,7 @@ int lib_interface_isis_area_tag_modify(struct nb_cb_modify_args *args) if (!ifp) return NB_OK; - isis = isis_lookup_by_vrfid(ifp->vrf_id); - if (isis == NULL) - return NB_ERR_VALIDATION; - - circuit = circuit_lookup_by_ifp(ifp, isis->init_circ_list); + circuit = circuit_scan_by_ifp(ifp); area_tag = yang_dnode_get_string(args->dnode, NULL); if (circuit && circuit->area && circuit->area->area_tag && strcmp(circuit->area->area_tag, area_tag)) { diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 63191d5cb5..8e5cb5bb36 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -2486,20 +2486,25 @@ static void ospfTrapVirtNbrStateChange(struct ospf_neighbor *on) static int ospf_snmp_nsm_change(struct ospf_neighbor *nbr, int next_state, int old_state) { - /* Terminal state or regression */ - if ((next_state == NSM_Full) || (next_state == NSM_TwoWay) - || (next_state < old_state)) { - /* ospfVirtNbrStateChange */ - if (nbr->oi->type == OSPF_IFTYPE_VIRTUALLINK) - ospfTrapVirtNbrStateChange(nbr); - /* ospfNbrStateChange trap */ - else - /* To/From FULL, only managed by DR */ - if (((next_state != NSM_Full) - && (nbr->state != NSM_Full)) - || (nbr->oi->state == ISM_DR)) - ospfTrapNbrStateChange(nbr); - } + /* Transition to/from state Full should be handled only by + * DR when in Broadcast or Non-Brodcast Multi-Access networks + */ + if ((next_state == NSM_Full || old_state == NSM_Full) + && (nbr->oi->state != ISM_DR) + && (nbr->oi->type == OSPF_IFTYPE_BROADCAST + || nbr->oi->type == OSPF_IFTYPE_NBMA)) + return 0; + + /* State progression to non-terminal state */ + if (next_state > old_state && next_state != NSM_Full + && next_state != NSM_TwoWay) + return 0; + + if (nbr->oi->type == OSPF_IFTYPE_VIRTUALLINK) + ospfTrapVirtNbrStateChange(nbr); + else + ospfTrapNbrStateChange(nbr); + return 0; } |
