From 7ec428d19a86428f2e68b63ddf9f1c043fd9ab52 Mon Sep 17 00:00:00 2001 From: Abdul Karim Date: Wed, 13 Sep 2023 00:27:32 +0100 Subject: [PATCH] ncm-network: nmstate: handle command routes and rule cleanly nmstate dossn't appear to handle route or rule commands. ignore any routes or rule which sets command with a warn. Fixes #1627 --- ncm-network/src/main/perl/nmstate.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ncm-network/src/main/perl/nmstate.pm b/ncm-network/src/main/perl/nmstate.pm index e868b764e4..c48c594b0a 100644 --- a/ncm-network/src/main/perl/nmstate.pm +++ b/ncm-network/src/main/perl/nmstate.pm @@ -108,6 +108,10 @@ sub make_nm_ip_rule my @rule_entry; foreach my $rule (@$rules) { + if ($rule->{command}){ + $self->warn("Rule command entry not supported with nmstate, ignoring '$rule->{command}'"); + next; + }; my %thisrule; my $priority = 100; $priority = $rule->{priority} if $rule->{priority}; @@ -128,6 +132,12 @@ sub make_nm_ip_route my ($self, $device, $routes, $routing_table_hash) = @_; my @rt_entry; foreach my $route (@$routes) { + if ($route->{command}){ + # TODO: perhaps run ip add route $route->{command} ? + # Speak to RHEL for support for unreachable route with nmstate. + $self->warn("Route command entry not supported with nmstate, ignoring '$route->{command}'"); + next; + }; my %rt; if ($route->{address} eq 'default') { $rt{destination} = '0.0.0.0/0';