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. --- nest/rt-dev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nest/rt-dev.c') diff --git a/nest/rt-dev.c b/nest/rt-dev.c index af6506f6..9953e270 100644 --- a/nest/rt-dev.c +++ b/nest/rt-dev.c @@ -84,11 +84,16 @@ dev_ifa_notify(struct proto *P, uint flags, struct ifa *ad) rta a0 = { .dest = RTD_UNICAST, - .nh.iface = ad->iface, + }; + + struct nexthop_adata nhad = { + .nh = { .iface = ad->iface, }, + .ad = { .length = (void *) NEXTHOP_NEXT(&nhad.nh) - (void *) nhad.ad.data, }, }; ea_set_attr_u32(&a0.eattrs, &ea_gen_preference, 0, c->preference); ea_set_attr_u32(&a0.eattrs, &ea_gen_source, 0, RTS_DEVICE); + ea_set_attr_data(&a0.eattrs, &ea_gen_nexthop, 0, nhad.ad.data, nhad.ad.length); a = rta_lookup(&a0); e = rte_get_temp(a, src); -- cgit v1.2.3