Merge pull request #9831 from manojvn/379909_383518

ospf6d: minor code enhancements.
This commit is contained in:
Igor Ryzhov 2021-10-28 20:05:16 +03:00 committed by GitHub
commit fd4bd21eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View File

@ -1308,7 +1308,8 @@ static void ospf6_asbr_redistribute_set(struct ospf6 *ospf6, int type)
{ {
ospf6_zebra_redistribute(type, ospf6->vrf_id); ospf6_zebra_redistribute(type, ospf6->vrf_id);
ospf6_asbr_status_update(ospf6, ++ospf6->redist_count); ++ospf6->redist_count;
ospf6_asbr_status_update(ospf6, ospf6->redist_count);
} }
static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6, static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
@ -1330,7 +1331,8 @@ static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
} }
ospf6_asbr_routemap_unset(red); ospf6_asbr_routemap_unset(red);
ospf6_asbr_status_update(ospf6, --ospf6->redist_count); --ospf6->redist_count;
ospf6_asbr_status_update(ospf6, ospf6->redist_count);
} }
/* When an area is unstubified, flood all the external LSAs in the area */ /* When an area is unstubified, flood all the external LSAs in the area */

View File

@ -188,12 +188,15 @@ void ospf6_abr_nssa_check_status(struct ospf6 *ospf6)
* when they are not translating. * when they are not translating.
*/ */
if (old_state != area->NSSATranslatorState) { if (old_state != area->NSSATranslatorState) {
if (old_state == OSPF6_NSSA_TRANSLATE_DISABLED) if (old_state == OSPF6_NSSA_TRANSLATE_DISABLED) {
++ospf6->redist_count;
ospf6_asbr_status_update(ospf6, ospf6_asbr_status_update(ospf6,
++ospf6->redist_count); ospf6->redist_count);
else } else {
--ospf6->redist_count;
ospf6_asbr_status_update(ospf6, ospf6_asbr_status_update(ospf6,
--ospf6->redist_count); ospf6->redist_count);
}
} }
} }
} }

View File

@ -580,9 +580,7 @@ ospf6_route_lookup_identical(struct ospf6_route *route,
for (target = ospf6_route_lookup(&route->prefix, table); target; for (target = ospf6_route_lookup(&route->prefix, table); target;
target = target->next) { target = target->next) {
if (target->type == route->type if (target->type == route->type
&& (memcmp(&target->prefix, &route->prefix, && prefix_same(&target->prefix, &route->prefix)
sizeof(struct prefix))
== 0)
&& target->path.type == route->path.type && target->path.type == route->path.type
&& target->path.cost == route->path.cost && target->path.cost == route->path.cost
&& target->path.u.cost_e2 == route->path.u.cost_e2 && target->path.u.cost_e2 == route->path.u.cost_e2

View File

@ -1039,7 +1039,6 @@ static uint8_t *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
return SNMP_INTEGER(OSPF6_LSA_IS_KNOWN(lsa->header->type) return SNMP_INTEGER(OSPF6_LSA_IS_KNOWN(lsa->header->type)
? SNMP_TRUE ? SNMP_TRUE
: SNMP_FALSE); : SNMP_FALSE);
break;
} }
return NULL; return NULL;
} }