summaryrefslogtreecommitdiff
path: root/sysdep/linux/netlink.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2020-02-13 16:59:53 +0100
committerMaria Matejka <mq@ucw.cz>2021-10-13 19:09:04 +0200
commite42eedb912428aa9af450b0426e53b0a7004dfb1 (patch)
treee7803a635e792deca9a3337f41731aae26b523e3 /sysdep/linux/netlink.c
parent3660f19dd534224da4870a507efcef5b36794506 (diff)
Kernel: Convert the rte-local attributes to extended attributes and flags to pflags
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r--sysdep/linux/netlink.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index b8619441..4ecd8878 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -1488,16 +1488,26 @@ nl_announce_route(struct nl_parse_state *s)
{
rte *e = rte_get_temp(s->attrs, s->proto->p.main_source);
e->net = s->net;
- e->u.krt.src = s->krt_src;
- e->u.krt.proto = s->krt_proto;
- e->u.krt.seen = 0;
- e->u.krt.best = 0;
- e->u.krt.metric = s->krt_metric;
+
+ ea_list *ea = alloca(sizeof(ea_list) + 2 * sizeof(eattr));
+ *ea = (ea_list) { .count = 2, .next = e->attrs->eattrs };
+ e->attrs->eattrs = ea;
+
+ ea->attrs[0] = (eattr) {
+ .id = EA_KRT_SOURCE,
+ .type = EAF_TYPE_INT,
+ .u.data = s->krt_proto,
+ };
+ ea->attrs[1] = (eattr) {
+ .id = EA_KRT_METRIC,
+ .type = EAF_TYPE_INT,
+ .u.data = s->krt_metric,
+ };
if (s->scan)
- krt_got_route(s->proto, e);
+ krt_got_route(s->proto, e, s->krt_src);
else
- krt_got_route_async(s->proto, e, s->new);
+ krt_got_route_async(s->proto, e, s->new, s->krt_src);
s->net = NULL;
s->attrs = NULL;