diff options
author | Maria Matejka <mq@ucw.cz> | 2022-07-14 11:09:23 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-07-14 12:13:18 +0200 |
commit | 1c2851ecfa94f3d0b732a267c6c2db8b817c37f4 (patch) | |
tree | 82a4121164b1b4063644373a7e3ecd11d88b3896 /nest/rt.h | |
parent | 239edf8d315f90de23c3ff6c68be77049fa6fa05 (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.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 */ |