From: Maria Matejka Date: Mon, 30 May 2022 13:35:29 +0000 (+0200) Subject: Merge commit '98fd158e28d89f10ee7a41b4f6a14fbd0021ef35' into haugesund X-Git-Tag: v3.0-alpha1~171^2~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef3a8138c909baf58c61ddf2edd815eab899d3a6;p=thirdparty%2Fbird.git Merge commit '98fd158e28d89f10ee7a41b4f6a14fbd0021ef35' into haugesund --- ef3a8138c909baf58c61ddf2edd815eab899d3a6 diff --cc proto/rip/rip.c index eeca78343,6ca7a6b53..5bf1b3e60 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@@ -188,34 -193,47 +193,46 @@@ rip_announce_rte(struct rip_proto *p, s a0.nh.iface = rt->from->ifa->iface; } - a0.eattrs = alloca(sizeof(ea_list) + 3*sizeof(eattr)); - memset(a0.eattrs, 0, sizeof(ea_list)); /* Zero-ing only the ea_list header */ - a0.eattrs->count = 3; - a0.eattrs->attrs[0] = (eattr) { - .id = EA_RIP_METRIC, - .type = EAF_TYPE_INT, - .u.data = rt_metric, - }; - a0.eattrs->attrs[1] = (eattr) { - .id = EA_RIP_TAG, - .type = EAF_TYPE_INT, - .u.data = rt_tag, - }; - a0.eattrs->attrs[2] = (eattr) { - .id = EA_RIP_FROM, - .type = EAF_TYPE_PTR, - .u.data = (uintptr_t) a0.nh.iface, + struct { + ea_list l; + eattr e[3]; + struct rip_iface_adata riad; + } ea_block = { + .l = { .count = 3, }, + .e = { + { + .id = EA_RIP_METRIC, + .type = EAF_TYPE_INT, + .u.data = rt_metric, + }, + { + .id = EA_RIP_TAG, + .type = EAF_TYPE_INT, + .u.data = rt_tag, + }, + { + .id = EA_RIP_FROM, + .type = EAF_TYPE_IFACE, + .u.ptr = &ea_block.riad.ad, + } + }, + .riad = { + .ad = { .length = sizeof(struct rip_iface_adata) - sizeof(struct adata) }, + .iface = a0.nh.iface, + }, }; + a0.eattrs = &ea_block.l; + - rta *a = rta_lookup(&a0); - rte *e = rte_get_temp(a, p->p.main_source); + rte e0 = { + .attrs = &a0, + .src = p->p.main_source, + }; - rte_update(&p->p, en->n.addr, e); + rte_update(p->p.main_channel, en->n.addr, &e0, p->p.main_source); } else - { - /* Withdraw */ - rte_update(&p->p, en->n.addr, NULL); - } + rte_update(p->p.main_channel, en->n.addr, NULL, p->p.main_source); } /**