1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

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.
This commit is contained in:
Ondrej Zajicek
2023-10-05 17:54:43 +02:00
parent de09fda5dc
commit ba01a6f2e6
3 changed files with 10 additions and 2 deletions

View File

@ -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");