summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-05 18:08:37 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-26 12:34:26 +0200
commitf15f2fcee7eeb5a100bd204a0e67018e25953420 (patch)
tree12a99cfb8b6ee5aba555af282b356fb712457b18 /sysdep/unix
parentf2e725a76882ba6b75c3ce4fb3c760bd83462410 (diff)
Moved nexthop from struct rta to extended attribute.
This doesn't do anything more than to put the whole structure inside adata. The overall performance is certainly going downhill; we'll optimize this later. Anyway, this is one of the latest items inside rta and in several commits we may drop rta completely and move to eattrs-only routes.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index b8e7670e..89e9e97e 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -611,10 +611,14 @@ krt_same_dest(rte *k, rte *e)
if (ka->dest != ea->dest)
return 0;
- if (ka->dest == RTD_UNICAST)
- return nexthop_same(&(ka->nh), &(ea->nh));
+ if (ka->dest != RTD_UNICAST)
+ return 1;
- return 1;
+ eattr *nhea_k = ea_find(ka->eattrs, &ea_gen_nexthop);
+ eattr *nhea_e = ea_find(ea->eattrs, &ea_gen_nexthop);
+
+ ASSUME(nhea_k && nhea_e);
+ return adata_same(nhea_k->u.ptr, nhea_e->u.ptr);
}
/*