From cf07d8ad79273a3bbf0617c17e438602e4b64ece Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 14 Apr 2022 18:32:19 +0200 Subject: Replaced boilerplate eattr allocation by ea_set_attr() --- sysdep/bsd/krt-sock.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'sysdep/bsd/krt-sock.c') diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index cd449d11..844b9f83 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -583,15 +583,8 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan) e = rte_get_temp(&a); e->net = net; - ea_list *ea = alloca(sizeof(ea_list) + 1 * sizeof(eattr)); - *ea = (ea_list) { .count = 1, .next = e->attrs->eattrs }; - e->attrs->eattrs = ea; - - ea->attrs[0] = (eattr) { - .id = EA_KRT_SOURCE, - .type = T_INT, - .u.data = src2, - }; + ea_set_attr(e->attrs->eattrs, + EA_LITERAL_EMBEDDED(EA_KRT_SOURCE, T_INT, 0, src2)); if (scan) krt_got_route(p, e, src); -- cgit v1.2.3