]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Kernel: Before first scan, reject exported routes immediately in preexport
authorMaria Matejka <mq@ucw.cz>
Wed, 20 Dec 2023 14:36:50 +0000 (15:36 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 8 Jan 2024 08:23:35 +0000 (09:23 +0100)
sysdep/unix/krt.c

index 0897198cd045d7949454aa5d500922e2431f092f..54355e3198e2afa4b0b5f697a102bc9287838514 100644 (file)
@@ -726,6 +726,10 @@ krt_preexport(struct channel *C, rte *e)
   if (!krt_capable(e))
     return -1;
 
+  /* Before first scan we don't touch the routes */
+  if (!SKIP_BACK(struct krt_proto, p, C->proto)->ready)
+    return -1;
+
   return 0;
 }
 
@@ -747,8 +751,7 @@ krt_rt_notify(struct proto *P, struct channel *ch UNUSED, const net_addr *net,
     return;
 #endif
 
-  if (p->initialized)          /* Before first scan we don't touch the routes */
-    krt_replace_rte(p, net, new, old);
+  krt_replace_rte(p, net, new, old);
 }
 
 static void
@@ -813,6 +816,7 @@ krt_feed_end(struct channel *C)
   }
 
   p->ready = 1;
+  bmap_reset(&C->export_reject_map, 16);
   krt_scan_timer_kick(p);
 }