summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 17:26:25 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 17:26:25 +0200
commit41508ceac3cdd74ca705d3bfc6a79464bf38e0b5 (patch)
tree4a0506a93849b3b7e61faeeaba1af289e13d646a /proto/ospf/rt.c
parent65254128e105903b6b470c6b4bb4729f56cf81bc (diff)
parent1c30b689ddd032ef8000fb7836348a48ba3184ff (diff)
Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesund
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 0cfd3747..23b767bc 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -2004,11 +2004,19 @@ static inline int
ort_changed(ort *nf, rta *nr)
{
rta *or = nf->old_rta;
- return !or ||
+
+ if (!or ||
(nf->n.metric1 != nf->old_metric1) || (nf->n.metric2 != nf->old_metric2) ||
(nf->n.tag != nf->old_tag) || (nf->n.rid != nf->old_rid) ||
- (nr->source != or->source) || (nr->dest != or->dest) ||
- !nexthop_same(&(nr->nh), &(or->nh));
+ (nr->dest != or->dest) ||
+ !nexthop_same(&(nr->nh), &(or->nh)))
+ return 1;
+
+ if ( ea_get_int(nr->eattrs, &ea_gen_source, 0)
+ != ea_get_int(or->eattrs, &ea_gen_source, 0))
+ return 1;
+
+ return 0;
}
static void
@@ -2053,7 +2061,6 @@ again1:
if (nf->n.type) /* Add the route */
{
rta a0 = {
- .source = nf->n.type,
.dest = RTD_UNICAST,
.nh = *(nf->n.nhs),
};
@@ -2067,7 +2074,7 @@ again1:
struct {
ea_list l;
- eattr a[5];
+ eattr a[6];
} eattrs;
eattrs.l = (ea_list) {};
@@ -2075,6 +2082,9 @@ again1:
eattrs.a[eattrs.l.count++] =
EA_LITERAL_EMBEDDED(&ea_gen_preference, 0, p->p.main_channel->preference);
+ eattrs.a[eattrs.l.count++] =
+ EA_LITERAL_EMBEDDED(&ea_gen_source, 0, nf->n.type);
+
eattrs.a[eattrs.l.count++] =
EA_LITERAL_EMBEDDED(&ea_ospf_metric1, 0, nf->n.metric1);
@@ -2089,6 +2099,7 @@ again1:
eattrs.a[eattrs.l.count++] =
EA_LITERAL_EMBEDDED(&ea_ospf_router_id, 0, nf->n.rid);
+ ASSERT_DIE(ARRAY_SIZE(eattrs.a) >= eattrs.l.count);
a0.eattrs = &eattrs.l;
rta_free(nf->old_rta);