Skip to content

Commit

Permalink
Merge pull request #1628 from aka7/nmstate_bugfix
Browse files Browse the repository at this point in the history
ncm-network: nmstate: handle command routes and rule cleanly
  • Loading branch information
jrha authored Sep 13, 2023
2 parents d880a93 + 7ec428d commit 705b3bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ncm-network/src/main/perl/nmstate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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';
Expand Down

0 comments on commit 705b3bd

Please sign in to comment.