mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 09:17:42 +00:00
commit
bc79672d3e
@ -113,7 +113,6 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
|
|||||||
struct external_info *new;
|
struct external_info *new;
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
struct ospf_external *ext;
|
struct ospf_external *ext;
|
||||||
char inetbuf[INET6_BUFSIZ];
|
|
||||||
|
|
||||||
ext = ospf_external_lookup(ospf, type, instance);
|
ext = ospf_external_lookup(ospf, type, instance);
|
||||||
if (!ext)
|
if (!ext)
|
||||||
@ -121,26 +120,23 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
|
|||||||
|
|
||||||
rn = route_node_get(EXTERNAL_INFO(ext), (struct prefix *)&p);
|
rn = route_node_get(EXTERNAL_INFO(ext), (struct prefix *)&p);
|
||||||
/* If old info exists, -- discard new one or overwrite with new one? */
|
/* If old info exists, -- discard new one or overwrite with new one? */
|
||||||
if (rn)
|
if (rn && rn->info) {
|
||||||
if (rn->info) {
|
new = rn->info;
|
||||||
new = rn->info;
|
if ((new->ifindex == ifindex)
|
||||||
if ((new->ifindex == ifindex)
|
&& (new->nexthop.s_addr == nexthop.s_addr)
|
||||||
&& (new->nexthop.s_addr == nexthop.s_addr)
|
&& (new->tag == tag)) {
|
||||||
&& (new->tag == tag)) {
|
route_unlock_node(rn);
|
||||||
route_unlock_node(rn);
|
return NULL; /* NULL => no LSA to refresh */
|
||||||
return NULL; /* NULL => no LSA to refresh */
|
|
||||||
}
|
|
||||||
|
|
||||||
inet_ntop(AF_INET, (void *)&nexthop.s_addr, inetbuf,
|
|
||||||
sizeof(inetbuf));
|
|
||||||
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
|
|
||||||
zlog_debug(
|
|
||||||
"Redistribute[%s][%d][%u]: %pFX discarding old info with NH %s.",
|
|
||||||
ospf_redist_string(type), instance,
|
|
||||||
ospf->vrf_id, &p, inetbuf);
|
|
||||||
XFREE(MTYPE_OSPF_EXTERNAL_INFO, rn->info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
|
||||||
|
zlog_debug(
|
||||||
|
"Redistribute[%s][%d][%u]: %pFX discarding old info with NH %pI4.",
|
||||||
|
ospf_redist_string(type), instance,
|
||||||
|
ospf->vrf_id, &p, &nexthop.s_addr);
|
||||||
|
XFREE(MTYPE_OSPF_EXTERNAL_INFO, rn->info);
|
||||||
|
}
|
||||||
|
|
||||||
/* Create new External info instance. */
|
/* Create new External info instance. */
|
||||||
new = ospf_external_info_new(type, instance);
|
new = ospf_external_info_new(type, instance);
|
||||||
new->p = p;
|
new->p = p;
|
||||||
@ -155,12 +151,10 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
|
|||||||
rn->info = new;
|
rn->info = new;
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) {
|
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) {
|
||||||
inet_ntop(AF_INET, (void *)&nexthop.s_addr, inetbuf,
|
|
||||||
sizeof(inetbuf));
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"Redistribute[%s][%u]: %pFX external info created, with NH %s",
|
"Redistribute[%s][%u]: %pFX external info created, with NH %pI4",
|
||||||
ospf_redist_string(type), ospf->vrf_id,
|
ospf_redist_string(type), ospf->vrf_id, &p,
|
||||||
&p, inetbuf);
|
&nexthop.s_addr);
|
||||||
}
|
}
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
@ -329,34 +323,36 @@ void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Delete external info for specified type. */
|
/* Delete external info for specified type. */
|
||||||
if (EXTERNAL_INFO(ext))
|
if (!EXTERNAL_INFO(ext))
|
||||||
for (rn = route_top(EXTERNAL_INFO(ext)); rn;
|
return;
|
||||||
rn = route_next(rn))
|
|
||||||
if ((ei = rn->info)) {
|
|
||||||
struct ospf_external_aggr_rt *aggr;
|
|
||||||
|
|
||||||
if (is_prefix_default(&ei->p)
|
for (rn = route_top(EXTERNAL_INFO(ext)); rn; rn = route_next(rn)) {
|
||||||
&& ospf->default_originate
|
ei = rn->info;
|
||||||
!= DEFAULT_ORIGINATE_NONE)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
aggr = ei->aggr_route;
|
if (!ei)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (aggr)
|
struct ospf_external_aggr_rt *aggr;
|
||||||
ospf_unlink_ei_from_aggr(ospf, aggr,
|
|
||||||
ei);
|
if (is_prefix_default(&ei->p)
|
||||||
else if (ospf_external_info_find_lsa(ospf,
|
&& ospf->default_originate != DEFAULT_ORIGINATE_NONE)
|
||||||
&ei->p))
|
continue;
|
||||||
ospf_external_lsa_flush(
|
|
||||||
ospf, type, &ei->p,
|
aggr = ei->aggr_route;
|
||||||
|
|
||||||
|
if (aggr)
|
||||||
|
ospf_unlink_ei_from_aggr(ospf, aggr, ei);
|
||||||
|
else if (ospf_external_info_find_lsa(ospf, &ei->p))
|
||||||
|
ospf_external_lsa_flush(ospf, type, &ei->p,
|
||||||
ei->ifindex /*, ei->nexthop */);
|
ei->ifindex /*, ei->nexthop */);
|
||||||
|
|
||||||
ospf_external_info_free(ei);
|
ospf_external_info_free(ei);
|
||||||
route_unlock_node(rn);
|
route_unlock_node(rn);
|
||||||
rn->info = NULL;
|
rn->info = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* External Route Aggregator Handlers */
|
/* External Route Aggregator Handlers */
|
||||||
bool is_valid_summary_addr(struct prefix_ipv4 *p)
|
bool is_valid_summary_addr(struct prefix_ipv4 *p)
|
||||||
{
|
{
|
||||||
|
@ -1689,7 +1689,8 @@ void ospf_sr_ext_itf_add(struct ext_itf *exti)
|
|||||||
else
|
else
|
||||||
srl->nhlfe[1].nexthop = exti->rmt_itf_addr.value;
|
srl->nhlfe[1].nexthop = exti->rmt_itf_addr.value;
|
||||||
break;
|
break;
|
||||||
default:
|
case PREF_SID:
|
||||||
|
case LOCAL_SID:
|
||||||
/* Wrong SID Type. Abort! */
|
/* Wrong SID Type. Abort! */
|
||||||
XFREE(MTYPE_OSPF_SR_PARAMS, srl);
|
XFREE(MTYPE_OSPF_SR_PARAMS, srl);
|
||||||
return;
|
return;
|
||||||
|
@ -637,7 +637,8 @@ void ospf_zebra_update_prefix_sid(const struct sr_prefix *srp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
case ADJ_SID:
|
||||||
|
case LAN_ADJ_SID:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,12 +766,12 @@ int ospf_is_type_redistributed(struct ospf *ospf, int type,
|
|||||||
ospf->vrf_id)
|
ospf->vrf_id)
|
||||||
: ((instance
|
: ((instance
|
||||||
&& redist_check_instance(
|
&& redist_check_instance(
|
||||||
&zclient->mi_redist[AFI_IP][type],
|
&zclient->mi_redist[AFI_IP][type],
|
||||||
instance))
|
instance))
|
||||||
|| (!instance
|
|| (!instance
|
||||||
&& vrf_bitmap_check(
|
&& vrf_bitmap_check(
|
||||||
zclient->redist[AFI_IP][type],
|
zclient->redist[AFI_IP][type],
|
||||||
ospf->vrf_id))));
|
ospf->vrf_id))));
|
||||||
}
|
}
|
||||||
|
|
||||||
int ospf_redistribute_set(struct ospf *ospf, int type, unsigned short instance,
|
int ospf_redistribute_set(struct ospf *ospf, int type, unsigned short instance,
|
||||||
@ -1262,104 +1263,92 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ospf->router_id.s_addr != INADDR_ANY) {
|
if (ospf->router_id.s_addr != INADDR_ANY) {
|
||||||
if (ei) {
|
if (is_prefix_default(&p))
|
||||||
if (is_prefix_default(&p))
|
ospf_external_lsa_refresh_default(ospf);
|
||||||
ospf_external_lsa_refresh_default(ospf);
|
else {
|
||||||
else {
|
struct ospf_external_aggr_rt *aggr;
|
||||||
struct ospf_external_aggr_rt *aggr;
|
struct as_external_lsa *al;
|
||||||
struct as_external_lsa *al;
|
struct ospf_lsa *lsa = NULL;
|
||||||
struct ospf_lsa *lsa = NULL;
|
struct in_addr mask;
|
||||||
struct in_addr mask;
|
|
||||||
|
|
||||||
aggr = ospf_external_aggr_match(ospf,
|
aggr = ospf_external_aggr_match(ospf, &ei->p);
|
||||||
&ei->p);
|
|
||||||
|
|
||||||
if (aggr) {
|
if (aggr) {
|
||||||
/* Check the AS-external-LSA
|
/* Check the AS-external-LSA
|
||||||
* should be originated.
|
* should be originated.
|
||||||
|
*/
|
||||||
|
if (!ospf_redistribute_check(ospf, ei,
|
||||||
|
NULL))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (IS_DEBUG_OSPF(lsa, EXTNL_LSA_AGGR))
|
||||||
|
zlog_debug(
|
||||||
|
"%s: Send Aggreate LSA (%pI4/%d)",
|
||||||
|
__func__,
|
||||||
|
&aggr->p.prefix,
|
||||||
|
aggr->p.prefixlen);
|
||||||
|
|
||||||
|
ospf_originate_summary_lsa(ospf, aggr,
|
||||||
|
ei);
|
||||||
|
|
||||||
|
/* Handling the case where the
|
||||||
|
* external route prefix
|
||||||
|
* and aggegate prefix is same
|
||||||
|
* If same dont flush the
|
||||||
|
* originated
|
||||||
|
* external LSA.
|
||||||
|
*/
|
||||||
|
if (prefix_same(
|
||||||
|
(struct prefix *)&aggr->p,
|
||||||
|
(struct prefix *)&ei->p))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
lsa = ospf_external_info_find_lsa(
|
||||||
|
ospf, &ei->p);
|
||||||
|
|
||||||
|
if (lsa) {
|
||||||
|
al = (struct as_external_lsa *)
|
||||||
|
lsa->data;
|
||||||
|
masklen2ip(ei->p.prefixlen,
|
||||||
|
&mask);
|
||||||
|
|
||||||
|
if (mask.s_addr
|
||||||
|
!= al->mask.s_addr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ospf_external_lsa_flush(
|
||||||
|
ospf, ei->type, &ei->p,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
struct ospf_lsa *current;
|
||||||
|
|
||||||
|
current = ospf_external_info_find_lsa(
|
||||||
|
ospf, &ei->p);
|
||||||
|
if (!current) {
|
||||||
|
/* Check the
|
||||||
|
* AS-external-LSA
|
||||||
|
* should be
|
||||||
|
* originated.
|
||||||
*/
|
*/
|
||||||
if (!ospf_redistribute_check(
|
if (!ospf_redistribute_check(
|
||||||
ospf, ei, NULL))
|
ospf, ei, NULL))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF(
|
ospf_external_lsa_originate(
|
||||||
lsa,
|
ospf, ei);
|
||||||
EXTNL_LSA_AGGR))
|
|
||||||
zlog_debug(
|
|
||||||
"%s: Send Aggreate LSA (%pI4/%d)",
|
|
||||||
__func__,
|
|
||||||
&aggr->p.prefix,
|
|
||||||
aggr->p.prefixlen);
|
|
||||||
|
|
||||||
ospf_originate_summary_lsa(
|
|
||||||
ospf, aggr, ei);
|
|
||||||
|
|
||||||
/* Handling the case where the
|
|
||||||
* external route prefix
|
|
||||||
* and aggegate prefix is same
|
|
||||||
* If same dont flush the
|
|
||||||
* originated
|
|
||||||
* external LSA.
|
|
||||||
*/
|
|
||||||
if (prefix_same(
|
|
||||||
(struct prefix
|
|
||||||
*)&aggr->p,
|
|
||||||
(struct prefix *)&ei
|
|
||||||
->p))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
lsa = ospf_external_info_find_lsa(
|
|
||||||
ospf, &ei->p);
|
|
||||||
|
|
||||||
if (lsa) {
|
|
||||||
al = (struct
|
|
||||||
as_external_lsa *)
|
|
||||||
lsa->data;
|
|
||||||
masklen2ip(
|
|
||||||
ei->p.prefixlen,
|
|
||||||
&mask);
|
|
||||||
|
|
||||||
if (mask.s_addr
|
|
||||||
!= al->mask.s_addr)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ospf_external_lsa_flush(
|
|
||||||
ospf, ei->type,
|
|
||||||
&ei->p, 0);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
struct ospf_lsa *current;
|
if (IS_DEBUG_OSPF(
|
||||||
|
zebra,
|
||||||
current =
|
ZEBRA_REDISTRIBUTE))
|
||||||
ospf_external_info_find_lsa(
|
zlog_debug(
|
||||||
ospf, &ei->p);
|
"%s: %pI4 refreshing LSA",
|
||||||
if (!current) {
|
__func__,
|
||||||
/* Check the
|
&p.prefix);
|
||||||
* AS-external-LSA
|
ospf_external_lsa_refresh(
|
||||||
* should be
|
ospf, current, ei,
|
||||||
* originated.
|
LSA_REFRESH_FORCE,
|
||||||
*/
|
false);
|
||||||
if (!ospf_redistribute_check(
|
|
||||||
ospf, ei,
|
|
||||||
NULL))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ospf_external_lsa_originate(
|
|
||||||
ospf, ei);
|
|
||||||
} else {
|
|
||||||
if (IS_DEBUG_OSPF(
|
|
||||||
zebra,
|
|
||||||
ZEBRA_REDISTRIBUTE))
|
|
||||||
zlog_debug(
|
|
||||||
"%s: %pI4 refreshing LSA",
|
|
||||||
__func__,
|
|
||||||
&p.prefix);
|
|
||||||
ospf_external_lsa_refresh(
|
|
||||||
ospf, current,
|
|
||||||
ei,
|
|
||||||
LSA_REFRESH_FORCE,
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1371,20 +1360,19 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
|||||||
*/
|
*/
|
||||||
ospf_external_lsa_default_routemap_apply(ospf, ei, cmd);
|
ospf_external_lsa_default_routemap_apply(ospf, ei, cmd);
|
||||||
|
|
||||||
} else /* if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
|
} else { /* if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_DEL) */
|
||||||
{
|
|
||||||
struct ospf_external_aggr_rt *aggr;
|
struct ospf_external_aggr_rt *aggr;
|
||||||
|
|
||||||
ei = ospf_external_info_lookup(ospf, rt_type, api.instance, &p);
|
ei = ospf_external_info_lookup(ospf, rt_type, api.instance, &p);
|
||||||
if (ei == NULL)
|
if (ei == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
else
|
|
||||||
/*
|
/*
|
||||||
* Check if default-information originate i
|
* Check if default-information originate i
|
||||||
* with some routemap prefix/access list match.
|
* with some routemap prefix/access list match.
|
||||||
* Apply before ei is deleted.
|
* Apply before ei is deleted.
|
||||||
*/
|
*/
|
||||||
ospf_external_lsa_default_routemap_apply(ospf, ei, cmd);
|
ospf_external_lsa_default_routemap_apply(ospf, ei, cmd);
|
||||||
|
|
||||||
aggr = ospf_external_aggr_match(ospf, &ei->p);
|
aggr = ospf_external_aggr_match(ospf, &ei->p);
|
||||||
|
|
||||||
@ -1405,7 +1393,6 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1490,85 +1477,83 @@ static int ospf_distribute_list_update_timer(struct thread *thread)
|
|||||||
rt = ext->external_info;
|
rt = ext->external_info;
|
||||||
if (!rt)
|
if (!rt)
|
||||||
continue;
|
continue;
|
||||||
for (rn = route_top(rt); rn; rn = route_next(rn))
|
for (rn = route_top(rt); rn; rn = route_next(rn)) {
|
||||||
if ((ei = rn->info) != NULL) {
|
ei = rn->info;
|
||||||
if (is_prefix_default(&ei->p))
|
if (!ei)
|
||||||
default_refresh = 1;
|
continue;
|
||||||
else {
|
|
||||||
struct ospf_external_aggr_rt
|
|
||||||
*aggr;
|
|
||||||
aggr = ospf_external_aggr_match(
|
|
||||||
ospf, &ei->p);
|
|
||||||
if (aggr) {
|
|
||||||
/* Check the
|
|
||||||
* AS-external-LSA
|
|
||||||
* should be originated.
|
|
||||||
*/
|
|
||||||
if (!ospf_redistribute_check(
|
|
||||||
ospf, ei,
|
|
||||||
NULL)) {
|
|
||||||
|
|
||||||
ospf_unlink_ei_from_aggr(
|
if (is_prefix_default(&ei->p))
|
||||||
ospf,
|
default_refresh = 1;
|
||||||
aggr,
|
else {
|
||||||
ei);
|
struct ospf_external_aggr_rt *aggr;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF(
|
aggr = ospf_external_aggr_match(ospf,
|
||||||
lsa,
|
&ei->p);
|
||||||
EXTNL_LSA_AGGR))
|
if (aggr) {
|
||||||
zlog_debug(
|
/* Check the
|
||||||
"%s: Send Aggregate LSA (%pI4/%d)",
|
* AS-external-LSA
|
||||||
__func__,
|
* should be originated.
|
||||||
&aggr->p.prefix,
|
*/
|
||||||
aggr->p.prefixlen);
|
if (!ospf_redistribute_check(
|
||||||
|
ospf, ei, NULL)) {
|
||||||
|
|
||||||
/* Originate Aggregate
|
ospf_unlink_ei_from_aggr(
|
||||||
* LSA
|
|
||||||
*/
|
|
||||||
ospf_originate_summary_lsa(
|
|
||||||
ospf, aggr, ei);
|
ospf, aggr, ei);
|
||||||
} else if (
|
continue;
|
||||||
(lsa = ospf_external_info_find_lsa(
|
|
||||||
ospf,
|
|
||||||
&ei->p))) {
|
|
||||||
int force =
|
|
||||||
LSA_REFRESH_IF_CHANGED;
|
|
||||||
/* If this is a MaxAge
|
|
||||||
* LSA, we need to
|
|
||||||
* force refresh it
|
|
||||||
* because distribute
|
|
||||||
* settings might have
|
|
||||||
* changed and now,
|
|
||||||
* this LSA needs to be
|
|
||||||
* originated, not be
|
|
||||||
* removed.
|
|
||||||
* If we don't force
|
|
||||||
* refresh it, it will
|
|
||||||
* remain a MaxAge LSA
|
|
||||||
* because it will look
|
|
||||||
* like it hasn't
|
|
||||||
* changed. Neighbors
|
|
||||||
* will not receive
|
|
||||||
* updates for this LSA.
|
|
||||||
*/
|
|
||||||
if (IS_LSA_MAXAGE(lsa))
|
|
||||||
force = LSA_REFRESH_FORCE;
|
|
||||||
|
|
||||||
ospf_external_lsa_refresh(
|
|
||||||
ospf, lsa, ei,
|
|
||||||
force, false);
|
|
||||||
} else {
|
|
||||||
if (!ospf_redistribute_check(
|
|
||||||
ospf, ei,
|
|
||||||
NULL))
|
|
||||||
continue;
|
|
||||||
ospf_external_lsa_originate(
|
|
||||||
ospf, ei);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_DEBUG_OSPF(
|
||||||
|
lsa,
|
||||||
|
EXTNL_LSA_AGGR))
|
||||||
|
zlog_debug(
|
||||||
|
"%s: Send Aggregate LSA (%pI4/%d)",
|
||||||
|
__func__,
|
||||||
|
&aggr->p.prefix,
|
||||||
|
aggr->p.prefixlen);
|
||||||
|
|
||||||
|
/* Originate Aggregate
|
||||||
|
* LSA
|
||||||
|
*/
|
||||||
|
ospf_originate_summary_lsa(
|
||||||
|
ospf, aggr, ei);
|
||||||
|
} else if (
|
||||||
|
(lsa = ospf_external_info_find_lsa(
|
||||||
|
ospf, &ei->p))) {
|
||||||
|
int force =
|
||||||
|
LSA_REFRESH_IF_CHANGED;
|
||||||
|
/* If this is a MaxAge
|
||||||
|
* LSA, we need to
|
||||||
|
* force refresh it
|
||||||
|
* because distribute
|
||||||
|
* settings might have
|
||||||
|
* changed and now,
|
||||||
|
* this LSA needs to be
|
||||||
|
* originated, not be
|
||||||
|
* removed.
|
||||||
|
* If we don't force
|
||||||
|
* refresh it, it will
|
||||||
|
* remain a MaxAge LSA
|
||||||
|
* because it will look
|
||||||
|
* like it hasn't
|
||||||
|
* changed. Neighbors
|
||||||
|
* will not receive
|
||||||
|
* updates for this LSA.
|
||||||
|
*/
|
||||||
|
if (IS_LSA_MAXAGE(lsa))
|
||||||
|
force = LSA_REFRESH_FORCE;
|
||||||
|
|
||||||
|
ospf_external_lsa_refresh(
|
||||||
|
ospf, lsa, ei, force,
|
||||||
|
false);
|
||||||
|
} else {
|
||||||
|
if (!ospf_redistribute_check(
|
||||||
|
ospf, ei, NULL))
|
||||||
|
continue;
|
||||||
|
ospf_external_lsa_originate(
|
||||||
|
ospf, ei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (default_refresh)
|
if (default_refresh)
|
||||||
@ -1718,17 +1703,16 @@ void ospf_prefix_list_update(struct prefix_list *plist)
|
|||||||
struct ospf_redist *red;
|
struct ospf_redist *red;
|
||||||
|
|
||||||
red_list = ospf->redist[type];
|
red_list = ospf->redist[type];
|
||||||
if (red_list) {
|
if (!red_list)
|
||||||
for (ALL_LIST_ELEMENTS_RO(red_list, node,
|
continue;
|
||||||
red)) {
|
|
||||||
if (ROUTEMAP(red)) {
|
for (ALL_LIST_ELEMENTS_RO(red_list, node, red)) {
|
||||||
/* if route-map is not NULL
|
if (ROUTEMAP(red)) {
|
||||||
* it may be using
|
/* if route-map is not NULL
|
||||||
* this prefix list */
|
* it may be using
|
||||||
ospf_distribute_list_update(
|
* this prefix list */
|
||||||
ospf, type,
|
ospf_distribute_list_update(
|
||||||
red->instance);
|
ospf, type, red->instance);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1736,28 +1720,24 @@ void ospf_prefix_list_update(struct prefix_list *plist)
|
|||||||
/* Update area filter-lists. */
|
/* Update area filter-lists. */
|
||||||
for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
|
for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) {
|
||||||
/* Update filter-list in. */
|
/* Update filter-list in. */
|
||||||
if (PREFIX_NAME_IN(area))
|
if (PREFIX_NAME_IN(area)
|
||||||
if (strcmp(PREFIX_NAME_IN(area),
|
&& strcmp(PREFIX_NAME_IN(area),
|
||||||
prefix_list_name(plist))
|
prefix_list_name(plist))
|
||||||
== 0) {
|
== 0) {
|
||||||
PREFIX_LIST_IN(area) =
|
PREFIX_LIST_IN(area) = prefix_list_lookup(
|
||||||
prefix_list_lookup(
|
AFI_IP, PREFIX_NAME_IN(area));
|
||||||
AFI_IP,
|
abr_inv++;
|
||||||
PREFIX_NAME_IN(area));
|
}
|
||||||
abr_inv++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update filter-list out. */
|
/* Update filter-list out. */
|
||||||
if (PREFIX_NAME_OUT(area))
|
if (PREFIX_NAME_OUT(area)
|
||||||
if (strcmp(PREFIX_NAME_OUT(area),
|
&& strcmp(PREFIX_NAME_OUT(area),
|
||||||
prefix_list_name(plist))
|
prefix_list_name(plist))
|
||||||
== 0) {
|
== 0) {
|
||||||
PREFIX_LIST_IN(area) =
|
PREFIX_LIST_IN(area) = prefix_list_lookup(
|
||||||
prefix_list_lookup(
|
AFI_IP, PREFIX_NAME_OUT(area));
|
||||||
AFI_IP,
|
abr_inv++;
|
||||||
PREFIX_NAME_OUT(area));
|
}
|
||||||
abr_inv++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Schedule ABR task. */
|
/* Schedule ABR task. */
|
||||||
@ -1857,14 +1837,17 @@ void ospf_distance_reset(struct ospf *ospf)
|
|||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
struct ospf_distance *odistance;
|
struct ospf_distance *odistance;
|
||||||
|
|
||||||
for (rn = route_top(ospf->distance_table); rn; rn = route_next(rn))
|
for (rn = route_top(ospf->distance_table); rn; rn = route_next(rn)) {
|
||||||
if ((odistance = rn->info) != NULL) {
|
odistance = rn->info;
|
||||||
if (odistance->access_list)
|
if (!odistance)
|
||||||
free(odistance->access_list);
|
continue;
|
||||||
ospf_distance_free(odistance);
|
|
||||||
rn->info = NULL;
|
if (odistance->access_list)
|
||||||
route_unlock_node(rn);
|
free(odistance->access_list);
|
||||||
}
|
ospf_distance_free(odistance);
|
||||||
|
rn->info = NULL;
|
||||||
|
route_unlock_node(rn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ospf_distance_apply(struct ospf *ospf, struct prefix_ipv4 *p,
|
uint8_t ospf_distance_apply(struct ospf *ospf, struct prefix_ipv4 *p,
|
||||||
@ -1874,18 +1857,16 @@ uint8_t ospf_distance_apply(struct ospf *ospf, struct prefix_ipv4 *p,
|
|||||||
if (ospf == NULL)
|
if (ospf == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ospf->distance_intra)
|
if (ospf->distance_intra && or->path_type == OSPF_PATH_INTRA_AREA)
|
||||||
if (or->path_type == OSPF_PATH_INTRA_AREA)
|
return ospf->distance_intra;
|
||||||
return ospf->distance_intra;
|
|
||||||
|
|
||||||
if (ospf->distance_inter)
|
if (ospf->distance_inter && or->path_type == OSPF_PATH_INTER_AREA)
|
||||||
if (or->path_type == OSPF_PATH_INTER_AREA)
|
return ospf->distance_inter;
|
||||||
return ospf->distance_inter;
|
|
||||||
|
|
||||||
if (ospf->distance_external)
|
if (ospf->distance_external
|
||||||
if (or->path_type == OSPF_PATH_TYPE1_EXTERNAL ||
|
&& (or->path_type == OSPF_PATH_TYPE1_EXTERNAL ||
|
||||||
or->path_type == OSPF_PATH_TYPE2_EXTERNAL)
|
or->path_type == OSPF_PATH_TYPE2_EXTERNAL))
|
||||||
return ospf->distance_external;
|
return ospf->distance_external;
|
||||||
|
|
||||||
if (ospf->distance_all)
|
if (ospf->distance_all)
|
||||||
return ospf->distance_all;
|
return ospf->distance_all;
|
||||||
|
Loading…
Reference in New Issue
Block a user