summaryrefslogtreecommitdiff
path: root/sysdep/bsd/krt-sock.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-04-14 18:32:19 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-04 15:38:40 +0200
commitcf07d8ad79273a3bbf0617c17e438602e4b64ece (patch)
treef747ced6c101d48032e1f0185d0340b5fb3d69f3 /sysdep/bsd/krt-sock.c
parent1d309c4ce6e95b68c64a8f007f6dd2f1830a5707 (diff)
Replaced boilerplate eattr allocation by ea_set_attr()
Diffstat (limited to 'sysdep/bsd/krt-sock.c')
-rw-r--r--sysdep/bsd/krt-sock.c11
1 files changed, 2 insertions, 9 deletions
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);