summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-15 18:09:30 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 14:39:09 +0200
commit950775f6fa3d569a9d7cd05e33538d35e895d688 (patch)
tree81b4b23d5695e209301b252d0d282b05a0d67ac1 /proto/ospf
parent4fe9881d625f10e44109a649e369a413bd98de71 (diff)
Route destination field merged with nexthop attribute; splitting flowspec validation result out.
As there is either a nexthop or another destination specification (or othing in case of ROAs and Flowspec), it may be merged together. This code is somehow quirky and should be replaced in future by better implementation of nexthop. Also flowspec validation result has its own attribute now as it doesn't have anything to do with route nexthop.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/rt.c4
-rw-r--r--proto/ospf/topology.c11
2 files changed, 3 insertions, 12 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 6070fd34..afe4a01f 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1983,8 +1983,7 @@ ort_changed(ort *nf, rta *nr)
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->dest != or->dest))
+ (nf->n.tag != nf->old_tag) || (nf->n.rid != nf->old_rid))
return 1;
eattr *nhea_n = ea_find(nr->eattrs, &ea_gen_nexthop);
@@ -2049,7 +2048,6 @@ again1:
if (nf->n.type) /* Add the route */
{
rta a0 = {
- .dest = RTD_UNICAST,
};
struct {
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index ca4620cc..09ec9f28 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -1366,16 +1366,9 @@ ospf_rt_notify(struct proto *P, struct channel *ch UNUSED, net *n, rte *new, rte
uint tag = ea_get_int(a->eattrs, &ea_ospf_tag, 0);
ip_addr fwd = IPA_NONE;
- if (a->dest == RTD_UNICAST)
+ eattr *nhea = ea_find(a->eattrs, &ea_gen_nexthop);
+ if (nhea)
{
- eattr *nhea = ea_find(a->eattrs, &ea_gen_nexthop);
- if (!nhea)
- {
- log(L_ERR "%s: Unicast route without nexthop for %N",
- p->p.name, n->n.addr);
- return;
- }
-
struct nexthop_adata *nhad = (struct nexthop_adata *) nhea->u.ptr;
if (use_gw_for_fwaddr(p, nhad->nh.gw, nhad->nh.iface))
fwd = nhad->nh.gw;