summaryrefslogtreecommitdiff
path: root/nest/rt.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-14 11:09:23 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-14 12:13:18 +0200
commit1c2851ecfa94f3d0b732a267c6c2db8b817c37f4 (patch)
tree82a4121164b1b4063644373a7e3ecd11d88b3896 /nest/rt.h
parent239edf8d315f90de23c3ff6c68be77049fa6fa05 (diff)
Fixed invalid routes handling
The invalid routes were filtered out before they could ever get exported, yet some of the routines need them available, e.g. for display or import reload. Now the invalid routes are properly exported and dropped in channel export routines instead.
Diffstat (limited to 'nest/rt.h')
-rw-r--r--nest/rt.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/nest/rt.h b/nest/rt.h
index b13c06be..bdbea05b 100644
--- a/nest/rt.h
+++ b/nest/rt.h
@@ -167,8 +167,10 @@ struct rte_storage {
struct rte rte; /* Route data */
};
-#define RTE_COPY(r, l) ((r) ? (((*(l)) = (r)->rte), (l)) : NULL)
-#define RTE_OR_NULL(r) ((r) ? &((r)->rte) : NULL)
+#define RTE_COPY(r) ((r) ? (r)->rte : (rte) {})
+#define RTE_COPY_VALID(r) (((r) && (rte_is_valid(&(r)->rte))) ? (r)->rte : (rte) {})
+#define RTE_OR_NULL(r) ((r) ? &((r)->rte) : NULL)
+#define RTE_VALID_OR_NULL(r) (((r) && (rte_is_valid(&(r)->rte))) ? &((r)->rte) : NULL)
/* Table-channel connections */