mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 09:52:27 +00:00
2005-11-20 Paul Jakma <paul.jakma@sun.com>
* ospf_abr.c: (ospf_abr_announce_network_to_area) check returned LSA of ospf_summary_lsa_refresh and print warning if it failed. (ospf_abr_announce_network_to_area) similar (ospf_abr_announce_rtr_to_area) similar * ospf_lsa.c: (ospf_router_lsa_new) check LSA returned is valid. (ospf_router_lsa_originate) similar (ospf_router_lsa_refresh, ospf_network_lsa_new) similar (ospf_summary_lsa_new) Check ID is valid. (ospf_summary_lsa_originate) ditto, and check returned LSA from previous function is !NULL. (ospf_summary_lsa_refresh) check ospf_summary_lsa_new return is !NULL. (ospf_summary_asbr_lsa_new) ID valid check. (ospf_summary_asbr_lsa_originate) similar.
This commit is contained in:
parent
b29800a676
commit
c24d602e82
@ -18,6 +18,21 @@
|
|||||||
timer needed.
|
timer needed.
|
||||||
* ospf_zebra.c: (ospf_router_id_update_zebra) call
|
* ospf_zebra.c: (ospf_router_id_update_zebra) call
|
||||||
ospf_router_id_update directly, not via timer.
|
ospf_router_id_update directly, not via timer.
|
||||||
|
* ospf_abr.c: (ospf_abr_announce_network_to_area) check
|
||||||
|
returned LSA of ospf_summary_lsa_refresh and print warning if
|
||||||
|
it failed.
|
||||||
|
(ospf_abr_announce_network_to_area) similar
|
||||||
|
(ospf_abr_announce_rtr_to_area) similar
|
||||||
|
* ospf_lsa.c: (ospf_router_lsa_new) check LSA returned is valid.
|
||||||
|
(ospf_router_lsa_originate) similar
|
||||||
|
(ospf_router_lsa_refresh, ospf_network_lsa_new) similar
|
||||||
|
(ospf_summary_lsa_new) Check ID is valid.
|
||||||
|
(ospf_summary_lsa_originate) ditto, and check returned LSA from
|
||||||
|
previous function is !NULL.
|
||||||
|
(ospf_summary_lsa_refresh) check ospf_summary_lsa_new return
|
||||||
|
is !NULL.
|
||||||
|
(ospf_summary_asbr_lsa_new) ID valid check.
|
||||||
|
(ospf_summary_asbr_lsa_originate) similar.
|
||||||
|
|
||||||
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
2005-11-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
|
||||||
|
|
||||||
|
@ -748,6 +748,19 @@ ospf_abr_announce_network_to_area (struct prefix_ipv4 *p, u_int32_t cost,
|
|||||||
"refreshing summary");
|
"refreshing summary");
|
||||||
set_metric (old, cost);
|
set_metric (old, cost);
|
||||||
lsa = ospf_summary_lsa_refresh (area->ospf, old);
|
lsa = ospf_summary_lsa_refresh (area->ospf, old);
|
||||||
|
|
||||||
|
if (!lsa)
|
||||||
|
{
|
||||||
|
char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
|
||||||
|
|
||||||
|
prefix2str ((struct prefix *) p, buf, sizeof(buf));
|
||||||
|
zlog_warn ("%s: Could not refresh %s to %s",
|
||||||
|
__func__,
|
||||||
|
buf,
|
||||||
|
inet_ntoa (area->area_id));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SET_FLAG (lsa->flags, OSPF_LSA_APPROVED);
|
SET_FLAG (lsa->flags, OSPF_LSA_APPROVED);
|
||||||
/* This will flood through area. */
|
/* This will flood through area. */
|
||||||
}
|
}
|
||||||
@ -760,6 +773,18 @@ ospf_abr_announce_network_to_area (struct prefix_ipv4 *p, u_int32_t cost,
|
|||||||
lsa = ospf_summary_lsa_originate ( (struct prefix_ipv4 *)p, cost, area);
|
lsa = ospf_summary_lsa_originate ( (struct prefix_ipv4 *)p, cost, area);
|
||||||
/* This will flood through area. */
|
/* This will flood through area. */
|
||||||
|
|
||||||
|
if (!lsa)
|
||||||
|
{
|
||||||
|
char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
|
||||||
|
|
||||||
|
prefix2str ((struct prefix *)p, buf, sizeof(buf));
|
||||||
|
zlog_warn ("%s: Could not originate %s to %s",
|
||||||
|
__func__,
|
||||||
|
buf,
|
||||||
|
inet_ntoa (area->area_id));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SET_FLAG (lsa->flags, OSPF_LSA_APPROVED);
|
SET_FLAG (lsa->flags, OSPF_LSA_APPROVED);
|
||||||
if (IS_DEBUG_OSPF_EVENT)
|
if (IS_DEBUG_OSPF_EVENT)
|
||||||
zlog_debug ("ospf_abr_announce_network_to_area(): "
|
zlog_debug ("ospf_abr_announce_network_to_area(): "
|
||||||
@ -1117,10 +1142,22 @@ ospf_abr_announce_rtr_to_area (struct prefix_ipv4 *p, u_int32_t cost,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
lsa = ospf_summary_asbr_lsa_originate (p, cost, area);
|
lsa = ospf_summary_asbr_lsa_originate (p, cost, area);
|
||||||
|
if (!lsa)
|
||||||
|
{
|
||||||
|
char buf[INET_ADDRSTRLEN + 3]; /* ipv4 and /XX */
|
||||||
|
|
||||||
|
prefix2str ((struct prefix *)p, buf, sizeof(buf));
|
||||||
|
zlog_warn ("%s: Could not refresh/originate %s to %s",
|
||||||
|
__func__,
|
||||||
|
buf,
|
||||||
|
inet_ntoa (area->area_id));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF_EVENT)
|
if (IS_DEBUG_OSPF_EVENT)
|
||||||
zlog_debug ("ospf_abr_announce_rtr_to_area(): "
|
zlog_debug ("ospf_abr_announce_rtr_to_area(): "
|
||||||
"flooding new version of summary");
|
"flooding new version of summary");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
zlog_info ("ospf_abr_announce_rtr_to_area(): creating new summary");
|
zlog_info ("ospf_abr_announce_rtr_to_area(): creating new summary");
|
||||||
lsa = ospf_summary_asbr_lsa (p, cost, area, old); */
|
lsa = ospf_summary_asbr_lsa (p, cost, area, old); */
|
||||||
|
@ -830,7 +830,12 @@ ospf_router_lsa_new (struct ospf_area *area)
|
|||||||
lsah->length = htons (length);
|
lsah->length = htons (length);
|
||||||
|
|
||||||
/* Now, create OSPF LSA instance. */
|
/* Now, create OSPF LSA instance. */
|
||||||
new = ospf_lsa_new ();
|
if ( (new = ospf_lsa_new ()) == NULL)
|
||||||
|
{
|
||||||
|
zlog_err ("%s: Unable to create new lsa", __func__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
new->area = area;
|
new->area = area;
|
||||||
SET_FLAG (new->flags, OSPF_LSA_SELF);
|
SET_FLAG (new->flags, OSPF_LSA_SELF);
|
||||||
|
|
||||||
@ -849,7 +854,11 @@ ospf_router_lsa_originate (struct ospf_area *area)
|
|||||||
struct ospf_lsa *new;
|
struct ospf_lsa *new;
|
||||||
|
|
||||||
/* Create new router-LSA instance. */
|
/* Create new router-LSA instance. */
|
||||||
new = ospf_router_lsa_new (area);
|
if ( (new = ospf_router_lsa_new (area)) == NULL)
|
||||||
|
{
|
||||||
|
zlog_err ("%s: ospf_router_lsa_new returned NULL", __func__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sanity check. */
|
/* Sanity check. */
|
||||||
if (new->data->adv_router.s_addr == 0)
|
if (new->data->adv_router.s_addr == 0)
|
||||||
@ -893,7 +902,12 @@ ospf_router_lsa_refresh (struct ospf_lsa *lsa)
|
|||||||
ospf_ls_retransmit_delete_nbr_area (area, lsa);
|
ospf_ls_retransmit_delete_nbr_area (area, lsa);
|
||||||
|
|
||||||
/* Create new router-LSA instance. */
|
/* Create new router-LSA instance. */
|
||||||
new = ospf_router_lsa_new (area);
|
if ( (new = ospf_router_lsa_new (area)) == NULL)
|
||||||
|
{
|
||||||
|
zlog_err ("%s: ospf_router_lsa_new returned NULL", __func__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
||||||
|
|
||||||
ospf_lsa_install (area->ospf, NULL, new);
|
ospf_lsa_install (area->ospf, NULL, new);
|
||||||
@ -1075,7 +1089,12 @@ ospf_network_lsa_new (struct ospf_interface *oi)
|
|||||||
lsah->length = htons (length);
|
lsah->length = htons (length);
|
||||||
|
|
||||||
/* Create OSPF LSA instance. */
|
/* Create OSPF LSA instance. */
|
||||||
new = ospf_lsa_new ();
|
if ( (new = ospf_lsa_new ()) == NULL)
|
||||||
|
{
|
||||||
|
zlog_err ("%s: ospf_lsa_new returned NULL", __func__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
new->area = oi->area;
|
new->area = oi->area;
|
||||||
SET_FLAG (new->flags, OSPF_LSA_SELF);
|
SET_FLAG (new->flags, OSPF_LSA_SELF);
|
||||||
|
|
||||||
@ -1242,6 +1261,15 @@ ospf_summary_lsa_new (struct ospf_area *area, struct prefix *p,
|
|||||||
struct lsa_header *lsah;
|
struct lsa_header *lsah;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
if (id.s_addr == 0xffffffff)
|
||||||
|
{
|
||||||
|
/* Maybe Link State ID not available. */
|
||||||
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
|
zlog_debug ("LSA[Type%d]: Link ID not available, can't originate",
|
||||||
|
OSPF_SUMMARY_LSA);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
zlog_debug ("LSA[Type3]: Create summary-LSA instance");
|
zlog_debug ("LSA[Type3]: Create summary-LSA instance");
|
||||||
|
|
||||||
@ -1282,8 +1310,18 @@ ospf_summary_lsa_originate (struct prefix_ipv4 *p, u_int32_t metric,
|
|||||||
|
|
||||||
id = ospf_lsa_unique_id (area->ospf, area->lsdb, OSPF_SUMMARY_LSA, p);
|
id = ospf_lsa_unique_id (area->ospf, area->lsdb, OSPF_SUMMARY_LSA, p);
|
||||||
|
|
||||||
|
if (id.s_addr == 0xffffffff)
|
||||||
|
{
|
||||||
|
/* Maybe Link State ID not available. */
|
||||||
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
|
zlog_debug ("LSA[Type%d]: Link ID not available, can't originate",
|
||||||
|
OSPF_SUMMARY_LSA);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create new summary-LSA instance. */
|
/* Create new summary-LSA instance. */
|
||||||
new = ospf_summary_lsa_new (area, (struct prefix *) p, metric, id);
|
if ( !(new = ospf_summary_lsa_new (area, (struct prefix *) p, metric, id)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Instlal LSA to LSDB. */
|
/* Instlal LSA to LSDB. */
|
||||||
new = ospf_lsa_install (area->ospf, NULL, new);
|
new = ospf_lsa_install (area->ospf, NULL, new);
|
||||||
@ -1319,6 +1357,9 @@ ospf_summary_lsa_refresh (struct ospf *ospf, struct ospf_lsa *lsa)
|
|||||||
new = ospf_summary_lsa_new (lsa->area, &p, GET_METRIC (sl->metric),
|
new = ospf_summary_lsa_new (lsa->area, &p, GET_METRIC (sl->metric),
|
||||||
sl->header.id);
|
sl->header.id);
|
||||||
|
|
||||||
|
if (!new)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
||||||
|
|
||||||
/* Re-calculate checksum. */
|
/* Re-calculate checksum. */
|
||||||
@ -1369,6 +1410,15 @@ ospf_summary_asbr_lsa_new (struct ospf_area *area, struct prefix *p,
|
|||||||
struct lsa_header *lsah;
|
struct lsa_header *lsah;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
if (id.s_addr == 0xffffffff)
|
||||||
|
{
|
||||||
|
/* Maybe Link State ID not available. */
|
||||||
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
|
zlog_debug ("LSA[Type%d]: Link ID not available, can't originate",
|
||||||
|
OSPF_ASBR_SUMMARY_LSA);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
zlog_debug ("LSA[Type3]: Create summary-LSA instance");
|
zlog_debug ("LSA[Type3]: Create summary-LSA instance");
|
||||||
|
|
||||||
@ -1409,8 +1459,19 @@ ospf_summary_asbr_lsa_originate (struct prefix_ipv4 *p, u_int32_t metric,
|
|||||||
|
|
||||||
id = ospf_lsa_unique_id (area->ospf, area->lsdb, OSPF_ASBR_SUMMARY_LSA, p);
|
id = ospf_lsa_unique_id (area->ospf, area->lsdb, OSPF_ASBR_SUMMARY_LSA, p);
|
||||||
|
|
||||||
|
if (id.s_addr == 0xffffffff)
|
||||||
|
{
|
||||||
|
/* Maybe Link State ID not available. */
|
||||||
|
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
|
||||||
|
zlog_debug ("LSA[Type%d]: Link ID not available, can't originate",
|
||||||
|
OSPF_ASBR_SUMMARY_LSA);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create new summary-LSA instance. */
|
/* Create new summary-LSA instance. */
|
||||||
new = ospf_summary_asbr_lsa_new (area, (struct prefix *) p, metric, id);
|
new = ospf_summary_asbr_lsa_new (area, (struct prefix *) p, metric, id);
|
||||||
|
if (!new)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Install LSA to LSDB. */
|
/* Install LSA to LSDB. */
|
||||||
new = ospf_lsa_install (area->ospf, NULL, new);
|
new = ospf_lsa_install (area->ospf, NULL, new);
|
||||||
@ -1445,6 +1506,8 @@ ospf_summary_asbr_lsa_refresh (struct ospf *ospf, struct ospf_lsa *lsa)
|
|||||||
p.prefixlen = ip_masklen (sl->mask);
|
p.prefixlen = ip_masklen (sl->mask);
|
||||||
new = ospf_summary_asbr_lsa_new (lsa->area, &p, GET_METRIC (sl->metric),
|
new = ospf_summary_asbr_lsa_new (lsa->area, &p, GET_METRIC (sl->metric),
|
||||||
sl->header.id);
|
sl->header.id);
|
||||||
|
if (!new)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
new->data->ls_seqnum = lsa_seqnum_increment (lsa);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user