diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-10-05 17:54:43 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-10-05 17:54:43 +0200 |
commit | ba01a6f2e66d03eb5d9426fdf4973f30e09c5710 (patch) | |
tree | 72d0b5c78acd009fb7756dfb960321b789552931 /nest/protocol.h | |
parent | de09fda5dcef16bf50663f7ffb56074e6ad20b5a (diff) |
MPLS: Handle compatibility with old configs
Old configs do not define MPLS domains and may use a static protocol
to define static MPLS routes.
When MPLS channel is the only channel of static protocol, handle it
as a main channel. Also, define implicit MPLS domain if needed and
none is defined.
Diffstat (limited to 'nest/protocol.h')
-rw-r--r-- | nest/protocol.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index af2a5d68..c87d3814 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -624,7 +624,7 @@ struct channel_config *proto_cf_find_channel(struct proto_config *p, uint net_ty static inline struct channel_config *proto_cf_main_channel(struct proto_config *pc) { return proto_cf_find_channel(pc, pc->net_type); } static inline struct channel_config *proto_cf_mpls_channel(struct proto_config *pc) -{ return proto_cf_find_channel(pc, NET_MPLS); } +{ return (pc->net_type != NET_MPLS) ? proto_cf_find_channel(pc, NET_MPLS) : NULL; } struct channel *proto_find_channel_by_table(struct proto *p, struct rtable *t); struct channel *proto_find_channel_by_name(struct proto *p, const char *n); |