summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt.c
diff options
context:
space:
mode:
authorMaria Jan Matejka <mq@jmq.cz>2021-12-07 16:59:44 +0000
committerMaria Jan Matejka <mq@jmq.cz>2021-12-07 16:59:44 +0000
commit493d45d95076ea1f375346942a1ce4e21dcc55e6 (patch)
treecf1a9fe0166f88d63f36d0dff2261010127549db /sysdep/unix/krt.c
parentf9e098c98af98096c8f47a054b57cff63d345074 (diff)
Fixed build errors for OpenBSD
Diffstat (limited to 'sysdep/unix/krt.c')
-rw-r--r--sysdep/unix/krt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index c0f2e930..0cb86213 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -681,7 +681,11 @@ static int
krt_preexport(struct channel *c, rte *e)
{
if (e->src->owner == &c->proto->sources)
+#ifdef CONFIG_SINGLE_ROUTE
+ return 1; /* Passing the route directly for rt_notify() to ignore */
+#else
return -1;
+#endif
if (!krt_capable(e))
return -1;
@@ -700,13 +704,10 @@ krt_rt_notify(struct proto *P, struct channel *ch UNUSED, const net_addr *net,
#ifdef CONFIG_SINGLE_ROUTE
/*
- * Implicit withdraw - when the imported kernel route becomes the best one,
- * we know that the previous one exported to the kernel was already removed,
- * but if we processed the update as usual, we would send withdraw to the
- * kernel, which would remove the new imported route instead.
+ * When the imported kernel route becomes the best one, we get it directly and
+ * we simply know that it is already there. Nothing to do.
*/
- rte *best = net->routes;
- if (!new && best && (best->attrs->src->proto == P))
+ if (new->src->owner == &P->sources)
return;
#endif