summaryrefslogtreecommitdiff
path: root/proto/static
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-10-05 17:54:43 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-10-05 17:54:43 +0200
commitba01a6f2e66d03eb5d9426fdf4973f30e09c5710 (patch)
tree72d0b5c78acd009fb7756dfb960321b789552931 /proto/static
parentde09fda5dcef16bf50663f7ffb56074e6ad20b5a (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 'proto/static')
-rw-r--r--proto/static/static.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/proto/static/static.c b/proto/static/static.c
index 0e80ad64..071803a8 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -472,6 +472,10 @@ static_postconfig(struct proto_config *CF)
struct static_config *cf = (void *) CF;
struct static_route *r;
+ /* If there is just a MPLS channel, use it as a main channel */
+ if (!CF->net_type && proto_cf_mpls_channel(CF))
+ CF->net_type = NET_MPLS;
+
if (! proto_cf_main_channel(CF))
cf_error("Channel not specified");