From f15f2fcee7eeb5a100bd204a0e67018e25953420 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 5 May 2022 18:08:37 +0200 Subject: 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. --- sysdep/unix/krt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sysdep/unix') 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); } /* -- cgit v1.2.3