summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_asbr.c1
-rw-r--r--ospf6d/ospf6_flood.c43
-rw-r--r--ospf6d/ospf6_interface.c2
-rw-r--r--ospf6d/ospf6_lsdb.h2
-rw-r--r--ospf6d/ospf6_nssa.c51
-rw-r--r--ospf6d/ospf6_top.h2
6 files changed, 68 insertions, 33 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 40afd716c7..63444f8e57 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1440,6 +1440,7 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
/* apply route-map */
if (ROUTEMAP(red)) {
troute.route_option = &tinfo;
+ troute.ospf6 = ospf6;
tinfo.ifindex = ifindex;
tinfo.tag = tag;
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index cc82084e5e..bc9e2c3405 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -878,6 +878,28 @@ static int ospf6_is_maxage_lsa_drop(struct ospf6_lsa *lsa,
return 0;
}
+static bool ospf6_lsa_check_min_arrival(struct ospf6_lsa *lsa,
+ struct ospf6_neighbor *from)
+{
+ struct timeval now, res;
+ unsigned int time_delta_ms;
+
+ monotime(&now);
+ timersub(&now, &lsa->installed, &res);
+ time_delta_ms = (res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
+
+ if (time_delta_ms < from->ospf6_if->area->ospf6->lsa_minarrival) {
+ if (IS_OSPF6_DEBUG_FLOODING ||
+ IS_OSPF6_DEBUG_FLOOD_TYPE(lsa->header->type))
+ zlog_debug(
+ "LSA can't be updated within MinLSArrival, %dms < %dms, discard",
+ time_delta_ms,
+ from->ospf6_if->area->ospf6->lsa_minarrival);
+ return true;
+ }
+ return false;
+}
+
/* RFC2328 section 13 The Flooding Procedure */
void ospf6_receive_lsa(struct ospf6_neighbor *from,
struct ospf6_lsa_header *lsa_header)
@@ -885,7 +907,6 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL;
int ismore_recent;
int is_debug = 0;
- unsigned int time_delta_ms;
ismore_recent = 1;
assert(from);
@@ -993,19 +1014,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
/* (a) MinLSArrival check */
if (old) {
- struct timeval now, res;
- monotime(&now);
- timersub(&now, &old->installed, &res);
- time_delta_ms =
- (res.tv_sec * 1000) + (int)(res.tv_usec / 1000);
- if (time_delta_ms
- < from->ospf6_if->area->ospf6->lsa_minarrival) {
- if (is_debug)
- zlog_debug(
- "LSA can't be updated within MinLSArrival, %dms < %dms, discard",
- time_delta_ms,
- from->ospf6_if->area->ospf6
- ->lsa_minarrival);
+ if (ospf6_lsa_check_min_arrival(old, from)) {
ospf6_lsa_delete(new);
return; /* examin next lsa */
}
@@ -1222,7 +1231,11 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
__PRETTY_FUNCTION__, old->name);
}
- /* XXX, MinLSArrival check !? RFC 2328 13 (8) */
+ /* MinLSArrival check as per RFC 2328 13 (8) */
+ if (ospf6_lsa_check_min_arrival(old, from)) {
+ ospf6_lsa_delete(new);
+ return; /* examin next lsa */
+ }
ospf6_lsdb_add(ospf6_lsa_copy(old),
from->lsupdate_list);
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index b9ee3c3403..55f1a1c7b5 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -158,7 +158,7 @@ static uint32_t ospf6_interface_get_cost(struct ospf6_interface *oi)
ospf6 = oi->interface->vrf->info;
refbw = ospf6 ? ospf6->ref_bandwidth : OSPF6_REFERENCE_BANDWIDTH;
- /* A specifed ip ospf cost overrides a calculated one. */
+ /* A specified ip ospf cost overrides a calculated one. */
if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_NOAUTOCOST))
cost = oi->cost;
else {
diff --git a/ospf6d/ospf6_lsdb.h b/ospf6d/ospf6_lsdb.h
index 07c331af64..a3a4d5bb9f 100644
--- a/ospf6d/ospf6_lsdb.h
+++ b/ospf6d/ospf6_lsdb.h
@@ -71,7 +71,7 @@ extern struct ospf6_lsa *ospf6_lsdb_next(const struct route_node *iterend,
* Since we are locking the lsa in ospf6_lsdb_head
* and then unlocking it in ospf6_lsa_unlock, when
* we cache the next pointer we need to increment
- * the lock for the lsa so we don't accidently free
+ * the lock for the lsa so we don't accidentally free
* it really early.
*/
#define ALL_LSDB(lsdb, lsa, lsanext) \
diff --git a/ospf6d/ospf6_nssa.c b/ospf6d/ospf6_nssa.c
index 1220c32783..53b45d6ca3 100644
--- a/ospf6d/ospf6_nssa.c
+++ b/ospf6d/ospf6_nssa.c
@@ -613,7 +613,8 @@ struct ospf6_lsa *ospf6_translated_nssa_refresh(struct ospf6_area *area,
return new;
}
-static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *lsa)
+static void ospf6_abr_translate_nssa(struct ospf6_area *area,
+ struct ospf6_lsa *lsa)
{
/* Incoming Type-7 or aggregated Type-7
*
@@ -625,7 +626,7 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
* Later, any Unapproved Translated Type-5's are flushed/discarded
*/
- struct ospf6_lsa *old = NULL, *new = NULL;
+ struct ospf6_lsa *old = NULL;
struct ospf6_as_external_lsa *nssa_lsa;
struct prefix prefix;
struct ospf6_route *match;
@@ -661,11 +662,36 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
return;
}
+ /* Find the type-5 LSA in the area-range table */
+ match = ospf6_route_lookup_bestmatch(&prefix, area->nssa_range_table);
+ if (match && CHECK_FLAG(match->flag, OSPF6_ROUTE_NSSA_RANGE)) {
+ if (prefix_same(&prefix, &match->prefix)) {
+ /* The prefix range is being removed,
+ * no need to refresh
+ */
+ if
+ CHECK_FLAG(match->flag, OSPF6_ROUTE_REMOVE)
+ return;
+ } else {
+ if (!CHECK_FLAG(match->flag, OSPF6_ROUTE_REMOVE)) {
+ if (IS_OSPF6_DEBUG_NSSA)
+ zlog_debug(
+ "%s: LSA Id %pI4 suppressed by range %pFX of area %s",
+ __func__, &lsa->header->id,
+ &match->prefix, area->name);
+ /* LSA will be suppressed by area-range command,
+ * no need to refresh
+ */
+ return;
+ }
+ }
+ }
+
/* Find the existing AS-External LSA for this prefix */
- match = ospf6_route_lookup(&prefix, ospf6->external_table);
+ match = ospf6_route_lookup(&prefix, ospf6->route_table);
if (match) {
- old = ospf6_lsdb_lookup(OSPF6_LSTYPE_AS_EXTERNAL,
- match->path.origin.id, ospf6->router_id,
+ old = ospf6_lsdb_lookup(htons(OSPF6_LSTYPE_AS_EXTERNAL),
+ lsa->external_lsa_id, ospf6->router_id,
ospf6->lsdb);
}
@@ -675,20 +701,15 @@ static void ospf6_abr_translate_nssa(struct ospf6_area *area, struct ospf6_lsa *
return;
}
- if (old) {
+ if (old && !OSPF6_LSA_IS_MAXAGE(old)) {
if (IS_OSPF6_DEBUG_NSSA)
zlog_debug(
- "%s : found old translated LSA Id %pI4, refreshing",
+ "%s : found old translated LSA Id %pI4, skip",
__func__, &old->header->id);
- /* refresh */
- new = ospf6_translated_nssa_refresh(area, lsa, old);
- if (!new) {
- if (IS_OSPF6_DEBUG_NSSA)
- zlog_debug(
- "%s : could not refresh translated LSA Id %pI4",
- __func__, &old->header->id);
- }
+ UNSET_FLAG(old->flag, OSPF6_LSA_UNAPPROVED);
+ return;
+
} else {
/* no existing external route for this LSA Id
* originate translated LSA
diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h
index f06a3254ac..9dddd465fe 100644
--- a/ospf6d/ospf6_top.h
+++ b/ospf6d/ospf6_top.h
@@ -70,7 +70,7 @@ struct ospf6_gr_info {
};
struct ospf6_gr_helper {
- /* Gracefull restart Helper supported configs*/
+ /* Graceful restart Helper supported configs*/
/* Supported grace interval*/
uint32_t supported_grace_time;