summaryrefslogtreecommitdiff
path: root/sysdep/bsd
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-09 13:13:05 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-09 13:13:05 +0100
commit92b832380d31fc9995d6e45b3db4ce496fcb7837 (patch)
treed76415a8847aef820bb9c935a3906d670cfa7aed /sysdep/bsd
parent9b6db9f9b8e561d215e1df01169b15a9dfaba1b9 (diff)
parent1b9189d5fdab672f91600b7e72a1deeab277eafc (diff)
Merge commit '1b9189d5' into haugesund
Diffstat (limited to 'sysdep/bsd')
-rw-r--r--sysdep/bsd/krt-sock.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index efdb18a3..a37e8786 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -398,7 +398,6 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
/* p is NULL iff KRT_SHARED_SOCKET and !scan */
int ipv6;
- rte *e;
net *net;
sockaddr dst, gate, mask;
ip_addr idst, igate, imask;
@@ -519,7 +518,6 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
net = net_get(p->p.main_channel->table, &ndst);
rta a = {
- .src = p->p.main_source,
.source = RTS_INHERIT,
.scope = SCOPE_UNIVERSE,
};
@@ -579,13 +577,12 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
}
}
- done:
- e = rte_get_temp(&a);
- e->net = net;
+ done:;
+ rte e0 = { .attrs = &a, .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 = (ea_list) { .count = 1, .next = e0.attrs->eattrs };
+ e0.attrs->eattrs = ea;
ea->attrs[0] = (eattr) {
.id = EA_KRT_SOURCE,
@@ -594,9 +591,9 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
};
if (scan)
- krt_got_route(p, e, src);
+ krt_got_route(p, &e0, src);
else
- krt_got_route_async(p, e, new, src);
+ krt_got_route_async(p, &e0, new, src);
}
static void