From: Maria Matejka Date: Mon, 30 May 2022 15:27:03 +0000 (+0200) Subject: Merge commit 'f2e725a76882ba6b75c3ce4fb3c760bd83462410' into haugesund X-Git-Tag: v3.0-alpha1~171^2~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b0c89a47fa1f63248ceaa1e9c1b3948dd29a68d;p=thirdparty%2Fbird.git Merge commit 'f2e725a76882ba6b75c3ce4fb3c760bd83462410' into haugesund --- 7b0c89a47fa1f63248ceaa1e9c1b3948dd29a68d diff --cc lib/route.h index cfb08bbe5,5423ada3a..df648cf98 --- a/lib/route.h +++ b/lib/route.h @@@ -313,9 -310,13 +312,13 @@@ extern struct ea_class ea_gen_from /* Source: An old method to devise the route source protocol and kind. * To be superseded in a near future by something more informative. */ extern struct ea_class ea_gen_source; -static inline u32 rt_get_source_attr(rte *rt) +static inline u32 rt_get_source_attr(const rte *rt) { return ea_get_int(rt->attrs->eattrs, &ea_gen_source, 0); } + /* MPLS labels: Use with a recursive nexthop specification + * to add additional labels to the resolved nexthop */ + extern struct ea_class ea_mpls_labels; + /* Next hop structures */ #define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK) diff --cc nest/rt-table.c index 3f3aee18f,37f17bbcf..ba4f51153 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@@ -2620,16 -2499,15 +2618,13 @@@ rt_next_hop_update_rte(rtable *tab, ne rta *a = alloca(RTA_MAX_SIZE); memcpy(a, old->attrs, rta_size(old->attrs)); - mpls_label_stack mls = { .len = a->nh.labels_orig }; - memcpy(mls.stack, &a->nh.label[a->nh.labels - mls.len], mls.len * sizeof(u32)); - - rta_apply_hostentry(a, old->attrs->hostentry, &mls); + rta_apply_hostentry(a, old->attrs->hostentry); a->cached = 0; - rte *e = sl_alloc(rte_slab); - memcpy(e, old, sizeof(rte)); - e->attrs = rta_lookup(a); - rt_lock_source(e->src); + rte e0 = *old; + e0.attrs = a; - return e; + return rte_store(&e0, n, tab); }