Page MenuHomeFreeBSD

D61577.1794767630.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61577.1794767630.diff

diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -734,7 +734,11 @@
return (result == FLM_SUCCESS);
}
-static bool
+/*
+ * Fills in queue entry @ce with the change described by @rc.
+ * The caller holds the reference to the new nexthop.
+ */
+static void
fill_change_entry(struct fib_data *fd, struct fib_change_entry *ce, struct rib_cmd_info *rc)
{
int plen = 0;
@@ -755,12 +759,6 @@
ce->plen = plen;
ce->nh_old = rc->rc_nh_old;
ce->nh_new = rc->rc_nh_new;
- if (ce->nh_new != NULL) {
- if (fib_ref_nhop(fd, ce->nh_new) == 0)
- return (false);
- }
-
- return (true);
}
static bool
@@ -787,7 +785,9 @@
q->size = q_size;
}
- return (fill_change_entry(fd, &q->entries[q->count++], rc));
+ fill_change_entry(fd, &q->entries[q->count++], rc);
+
+ return (true);
}
/*
@@ -827,21 +827,6 @@
return;
}
- /*
- * Algo requested updates to be delivered in batches.
- * Add the current change to the queue and return.
- */
- if (fd->fd_batch) {
- if (immediate_sync) {
- if (!queue_rtable_change(fd, rc) || !apply_rtable_changes(fd))
- rebuild_fd(fd, "batch sync failed");
- } else {
- if (!queue_rtable_change(fd, rc))
- schedule_fd_rebuild(fd, "batch queue failed");
- }
- return;
- }
-
/*
* Maintain guarantee that every nexthop returned by the dataplane
* lookup has > 0 refcount, so can be safely referenced within current
@@ -857,6 +842,21 @@
}
}
+ /*
+ * Algo requested updates to be delivered in batches.
+ * Add the current change to the queue and return.
+ */
+ if (fd->fd_batch) {
+ if (immediate_sync) {
+ if (!queue_rtable_change(fd, rc) || !apply_rtable_changes(fd))
+ rebuild_fd(fd, "batch sync failed");
+ } else {
+ if (!queue_rtable_change(fd, rc))
+ schedule_fd_rebuild(fd, "batch queue failed");
+ }
+ return;
+ }
+
result = fd->fd_flm->flm_change_rib_item_cb(rnh, rc, fd->fd_algo_data);
switch (result) {

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 6:33 PM (23 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41746676
Default Alt Text
D61577.1794767630.diff (1 KB)

Event Timeline