summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospfd/ospf_interface.c21
-rw-r--r--ospfd/ospf_route.c3
-rw-r--r--ospfd/ospf_route.h2
3 files changed, 26 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 334ed33ee0..b4e318d1d1 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -49,6 +49,7 @@
#include "ospfd/ospf_network.h"
#include "ospfd/ospf_dump.h"
#include "ospfd/ospf_ldp_sync.h"
+#include "ospfd/ospf_route.h"
DEFINE_QOBJ_TYPE(ospf_interface);
DEFINE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd));
@@ -804,6 +805,10 @@ int ospf_if_up(struct ospf_interface *oi)
int ospf_if_down(struct ospf_interface *oi)
{
struct ospf *ospf;
+ struct route_node *rn;
+ struct ospf_route *or;
+ struct listnode *nh;
+ struct ospf_path *op;
if (oi == NULL)
return 0;
@@ -840,6 +845,22 @@ int ospf_if_down(struct ospf_interface *oi)
/* Shutdown packet reception and sending */
ospf_if_stream_unset(oi);
+ for (rn = route_top(ospf->new_table); rn; rn = route_next(rn)) {
+ or = rn->info;
+
+ if (!or)
+ continue;
+
+ for (nh = listhead(or->paths); nh;
+ nh = listnextnode_unchecked(nh)) {
+ op = listgetdata(nh);
+ if (op->ifindex == oi->ifp->ifindex) {
+ or->changed = true;
+ break;
+ }
+ }
+ }
+
return 1;
}
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 7cfcaf14be..502a4a08c1 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -208,6 +208,9 @@ int ospf_route_match_same(struct route_table *rt, struct prefix_ipv4 *prefix,
or = rn->info;
if (or->type == newor->type && or->cost == newor->cost) {
+ if (or->changed)
+ return 0;
+
if (or->type == OSPF_DESTINATION_NETWORK) {
if (or->paths->count != newor->paths->count)
return 0;
diff --git a/ospfd/ospf_route.h b/ospfd/ospf_route.h
index 811581c0d3..c2ce0569db 100644
--- a/ospfd/ospf_route.h
+++ b/ospfd/ospf_route.h
@@ -124,6 +124,8 @@ struct ospf_route {
struct route_standard std;
struct route_external ext;
} u;
+
+ bool changed;
};
extern struct ospf_path *ospf_path_new(void);