From ba01a6f2e66d03eb5d9426fdf4973f30e09c5710 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 5 Oct 2023 17:54:43 +0200 Subject: 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. --- proto/static/static.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proto/static') 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"); -- cgit v1.2.3